Connector
, org.eclipse.jetty.util.component.Graceful
, org.eclipse.jetty.util.component.LifeCycle
public class LocalConnector extends AbstractConnector
HttpTester.Request request = HttpTester.newRequest(); request.setURI("/some/resource"); HttpTester.Response response = HttpTester.parseResponse(HttpTester.from(localConnector.getResponse(request.generate())));
Modifier and Type | Class | Description |
---|---|---|
class |
LocalConnector.LocalEndPoint |
Local EndPoint
|
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
LOG
Constructor | Description |
---|---|
LocalConnector(Server server) |
|
LocalConnector(Server server,
java.util.concurrent.Executor executor,
org.eclipse.jetty.util.thread.Scheduler scheduler,
org.eclipse.jetty.io.ByteBufferPool pool,
int acceptors,
ConnectionFactory... factories) |
|
LocalConnector(Server server,
ConnectionFactory connectionFactory) |
|
LocalConnector(Server server,
ConnectionFactory connectionFactory,
org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory) |
|
LocalConnector(Server server,
org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory) |
Modifier and Type | Method | Description |
---|---|---|
protected void |
accept(int acceptorID) |
|
LocalConnector.LocalEndPoint |
connect() |
|
LocalConnector.LocalEndPoint |
executeRequest(java.lang.String rawRequest) |
Execute a request and return the EndPoint through which
multiple responses can be received or more input provided.
|
java.lang.String |
getResponse(java.lang.String rawRequest) |
Get a single response using a parser to search for the end of the message.
|
java.lang.String |
getResponse(java.lang.String rawRequest,
boolean head,
long time,
java.util.concurrent.TimeUnit unit) |
Get a single response using a parser to search for the end of the message.
|
java.lang.String |
getResponse(java.lang.String rawRequest,
long time,
java.util.concurrent.TimeUnit unit) |
Get a single response using a parser to search for the end of the message.
|
java.nio.ByteBuffer |
getResponse(java.nio.ByteBuffer requestsBuffer) |
Get a single response using a parser to search for the end of the message.
|
java.nio.ByteBuffer |
getResponse(java.nio.ByteBuffer requestBuffer,
boolean head,
long time,
java.util.concurrent.TimeUnit unit) |
Get a single response using a parser to search for the end of the message.
|
java.nio.ByteBuffer |
getResponse(java.nio.ByteBuffer requestBuffer,
long time,
java.util.concurrent.TimeUnit unit) |
Get a single response using a parser to search for the end of the message.
|
java.lang.String |
getResponses(java.lang.String requests) |
Deprecated.
|
java.lang.String |
getResponses(java.lang.String requests,
long idleFor,
java.util.concurrent.TimeUnit units) |
Deprecated.
|
java.nio.ByteBuffer |
getResponses(java.nio.ByteBuffer requestsBuffer) |
Deprecated.
|
java.nio.ByteBuffer |
getResponses(java.nio.ByteBuffer requestsBuffer,
long idleFor,
java.util.concurrent.TimeUnit units) |
Deprecated.
|
java.lang.Object |
getTransport() |
addConnectionFactory, addFirstConnectionFactory, addIfAbsentConnectionFactory, clearConnectionFactories, doStart, doStop, getAcceptorPriorityDelta, getAcceptors, getByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getDefaultProtocol, getExecutor, getIdleTimeout, getName, getProtocols, getScheduler, getServer, handleAcceptFailure, interruptAcceptors, isAccepting, join, join, onEndPointClosed, onEndPointOpened, removeConnectionFactory, setAcceptorPriorityDelta, setConnectionFactories, setDefaultProtocol, setIdleTimeout, setName, shutdown, toString
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
public LocalConnector(Server server, java.util.concurrent.Executor executor, org.eclipse.jetty.util.thread.Scheduler scheduler, org.eclipse.jetty.io.ByteBufferPool pool, int acceptors, ConnectionFactory... factories)
public LocalConnector(Server server)
public LocalConnector(Server server, org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory)
public LocalConnector(Server server, ConnectionFactory connectionFactory)
public LocalConnector(Server server, ConnectionFactory connectionFactory, org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory)
public java.lang.Object getTransport()
@Deprecated public java.lang.String getResponses(java.lang.String requests) throws java.lang.Exception
getResponse(String)
This methods waits until the connection is closed or is idle for 5s before returning the responses.
Use getResponse(String)
for an alternative that does not wait for idle.
requests
- the requestsjava.lang.Exception
- if the requests fail@Deprecated public java.lang.String getResponses(java.lang.String requests, long idleFor, java.util.concurrent.TimeUnit units) throws java.lang.Exception
getResponse(String, boolean, long, TimeUnit)
This methods waits until the connection is closed or an idle period before returning the responses.
Use getResponse(String)
for an alternative that does not wait for idle.
requests
- the requestsidleFor
- The time the response stream must be idle for before returningunits
- The units of idleForjava.lang.Exception
- if the requests fail@Deprecated public java.nio.ByteBuffer getResponses(java.nio.ByteBuffer requestsBuffer) throws java.lang.Exception
getResponse(ByteBuffer)
This methods waits until the connection is closed or is idle for 5s before returning the responses.
Use getResponse(ByteBuffer)
for an alternative that does not wait for idle.
requestsBuffer
- the requestsjava.lang.Exception
- if the requests fail@Deprecated public java.nio.ByteBuffer getResponses(java.nio.ByteBuffer requestsBuffer, long idleFor, java.util.concurrent.TimeUnit units) throws java.lang.Exception
getResponse(ByteBuffer, boolean, long, TimeUnit)
This methods waits until the connection is closed or an idle period before returning the responses.
requestsBuffer
- the requestsidleFor
- The time the response stream must be idle for before returningunits
- The units of idleForjava.lang.Exception
- if the requests failpublic LocalConnector.LocalEndPoint executeRequest(java.lang.String rawRequest)
rawRequest
- the requestpublic LocalConnector.LocalEndPoint connect()
protected void accept(int acceptorID) throws java.io.IOException, java.lang.InterruptedException
accept
in class AbstractConnector
java.io.IOException
java.lang.InterruptedException
public java.nio.ByteBuffer getResponse(java.nio.ByteBuffer requestsBuffer) throws java.lang.Exception
requestsBuffer
- The request to sendjava.lang.Exception
- If there is a problempublic java.nio.ByteBuffer getResponse(java.nio.ByteBuffer requestBuffer, long time, java.util.concurrent.TimeUnit unit) throws java.lang.Exception
requestBuffer
- The request to sendtime
- The time to waitunit
- The units of the waitjava.lang.Exception
- If there is a problempublic java.nio.ByteBuffer getResponse(java.nio.ByteBuffer requestBuffer, boolean head, long time, java.util.concurrent.TimeUnit unit) throws java.lang.Exception
requestBuffer
- The request to sendhead
- True if the response is for a head requesttime
- The time to waitunit
- The units of the waitjava.lang.Exception
- If there is a problempublic java.lang.String getResponse(java.lang.String rawRequest) throws java.lang.Exception
rawRequest
- The request to sendjava.lang.Exception
- If there is a problempublic java.lang.String getResponse(java.lang.String rawRequest, long time, java.util.concurrent.TimeUnit unit) throws java.lang.Exception
rawRequest
- The request to sendtime
- The time to waitunit
- The units of the waitjava.lang.Exception
- If there is a problempublic java.lang.String getResponse(java.lang.String rawRequest, boolean head, long time, java.util.concurrent.TimeUnit unit) throws java.lang.Exception
rawRequest
- The request to sendhead
- True if the response is for a head requesttime
- The time to waitunit
- The units of the waitjava.lang.Exception
- If there is a problemCopyright © 1995–2018 Webtide. All rights reserved.