Package org.eclipse.jetty.server
Class LocalConnector
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.server.AbstractConnector
-
- org.eclipse.jetty.server.LocalConnector
-
- All Implemented Interfaces:
Connector
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,Graceful
,LifeCycle
@Deprecated(since="2021-05-27") public class LocalConnector extends AbstractConnector
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.A local connector, mostly for testing purposes.HttpTester.Request request = HttpTester.newRequest(); request.setURI("/some/resource"); HttpTester.Response response = HttpTester.parseResponse(HttpTester.from(localConnector.getResponse(request.generate())));
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
LocalConnector.LocalEndPoint
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Graceful
Graceful.Shutdown
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Constructor Summary
Constructors Constructor Description LocalConnector(Server server)
Deprecated.LocalConnector(Server server, java.util.concurrent.Executor executor, Scheduler scheduler, ByteBufferPool pool, int acceptors, ConnectionFactory... factories)
Deprecated.LocalConnector(Server server, ConnectionFactory connectionFactory)
Deprecated.LocalConnector(Server server, ConnectionFactory connectionFactory, SslContextFactory sslContextFactory)
Deprecated.LocalConnector(Server server, SslContextFactory sslContextFactory)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description LocalConnector.LocalEndPoint
connect()
Deprecated.LocalConnector.LocalEndPoint
executeRequest(java.lang.String rawRequest)
Deprecated.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)
Deprecated.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)
Deprecated.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)
Deprecated.Get a single response using a parser to search for the end of the message.java.nio.ByteBuffer
getResponse(java.nio.ByteBuffer requestsBuffer)
Deprecated.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)
Deprecated.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)
Deprecated.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()
Deprecated.-
Methods inherited from class org.eclipse.jetty.server.AbstractConnector
addConnectionFactory, addFirstConnectionFactory, addIfAbsentConnectionFactory, clearConnectionFactories, getAcceptorPriorityDelta, getAcceptors, getByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getDefaultProtocol, getExecutor, getHttpChannelListeners, getIdleTimeout, getName, getProtocols, getScheduler, getServer, isAccepting, isShutdown, join, join, removeConnectionFactory, setAccepting, setAcceptorPriorityDelta, setConnectionFactories, setDefaultProtocol, setIdleTimeout, setName, shutdown, toString
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Container
addBean, addBean, addEventListener, getBean, getBeans, getBeans, getContainedBeans, isManaged, manage, removeBean, removeEventListener, unmanage
-
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
-
-
-
Constructor Detail
-
LocalConnector
public LocalConnector(Server server, java.util.concurrent.Executor executor, Scheduler scheduler, ByteBufferPool pool, int acceptors, ConnectionFactory... factories)
Deprecated.
-
LocalConnector
public LocalConnector(Server server)
Deprecated.
-
LocalConnector
public LocalConnector(Server server, SslContextFactory sslContextFactory)
Deprecated.
-
LocalConnector
public LocalConnector(Server server, ConnectionFactory connectionFactory)
Deprecated.
-
LocalConnector
public LocalConnector(Server server, ConnectionFactory connectionFactory, SslContextFactory sslContextFactory)
Deprecated.
-
-
Method Detail
-
getTransport
public java.lang.Object getTransport()
Deprecated.- Returns:
- the underlying socket, channel, buffer etc. for the connector.
-
getResponses
@Deprecated public java.lang.String getResponses(java.lang.String requests) throws java.lang.Exception
Deprecated.Sends requests and get responses based on thread activity. Returns all the responses received once the thread activity has returned to the level it was before the requests.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.- Parameters:
requests
- the requests- Returns:
- the responses
- Throws:
java.lang.Exception
- if the requests fail
-
getResponses
@Deprecated public java.lang.String getResponses(java.lang.String requests, long idleFor, java.util.concurrent.TimeUnit units) throws java.lang.Exception
Deprecated.Sends requests and get responses based on thread activity. Returns all the responses received once the thread activity has returned to the level it was before the requests.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.- Parameters:
requests
- the requestsidleFor
- The time the response stream must be idle for before returningunits
- The units of idleFor- Returns:
- the responses
- Throws:
java.lang.Exception
- if the requests fail
-
getResponses
@Deprecated public java.nio.ByteBuffer getResponses(java.nio.ByteBuffer requestsBuffer) throws java.lang.Exception
Deprecated.Sends requests and get's responses based on thread activity. Returns all the responses received once the thread activity has returned to the level it was before the requests.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.- Parameters:
requestsBuffer
- the requests- Returns:
- the responses
- Throws:
java.lang.Exception
- if the requests fail
-
getResponses
@Deprecated public java.nio.ByteBuffer getResponses(java.nio.ByteBuffer requestsBuffer, long idleFor, java.util.concurrent.TimeUnit units) throws java.lang.Exception
Deprecated.Sends requests and get's responses based on thread activity. Returns all the responses received once the thread activity has returned to the level it was before the requests.This methods waits until the connection is closed or an idle period before returning the responses.
- Parameters:
requestsBuffer
- the requestsidleFor
- The time the response stream must be idle for before returningunits
- The units of idleFor- Returns:
- the responses
- Throws:
java.lang.Exception
- if the requests fail
-
executeRequest
public LocalConnector.LocalEndPoint executeRequest(java.lang.String rawRequest)
Deprecated.Execute a request and return the EndPoint through which multiple responses can be received or more input provided.- Parameters:
rawRequest
- the request- Returns:
- the local endpoint
-
connect
public LocalConnector.LocalEndPoint connect()
Deprecated.
-
getResponse
public java.nio.ByteBuffer getResponse(java.nio.ByteBuffer requestsBuffer) throws java.lang.Exception
Deprecated.Get a single response using a parser to search for the end of the message.- Parameters:
requestsBuffer
- The request to send- Returns:
- ByteBuffer containing response or null.
- Throws:
java.lang.Exception
- If there is a problem
-
getResponse
public java.nio.ByteBuffer getResponse(java.nio.ByteBuffer requestBuffer, long time, java.util.concurrent.TimeUnit unit) throws java.lang.Exception
Deprecated.Get a single response using a parser to search for the end of the message.- Parameters:
requestBuffer
- The request to sendtime
- The time to waitunit
- The units of the wait- Returns:
- ByteBuffer containing response or null.
- Throws:
java.lang.Exception
- If there is a problem
-
getResponse
public java.nio.ByteBuffer getResponse(java.nio.ByteBuffer requestBuffer, boolean head, long time, java.util.concurrent.TimeUnit unit) throws java.lang.Exception
Deprecated.Get a single response using a parser to search for the end of the message.- Parameters:
requestBuffer
- The request to sendhead
- True if the response is for a head requesttime
- The time to waitunit
- The units of the wait- Returns:
- ByteBuffer containing response or null.
- Throws:
java.lang.Exception
- If there is a problem
-
getResponse
public java.lang.String getResponse(java.lang.String rawRequest) throws java.lang.Exception
Deprecated.Get a single response using a parser to search for the end of the message.- Parameters:
rawRequest
- The request to send- Returns:
- ByteBuffer containing response or null.
- Throws:
java.lang.Exception
- If there is a problem
-
getResponse
public java.lang.String getResponse(java.lang.String rawRequest, long time, java.util.concurrent.TimeUnit unit) throws java.lang.Exception
Deprecated.Get a single response using a parser to search for the end of the message.- Parameters:
rawRequest
- The request to sendtime
- The time to waitunit
- The units of the wait- Returns:
- ByteBuffer containing response or null.
- Throws:
java.lang.Exception
- If there is a problem
-
getResponse
public java.lang.String getResponse(java.lang.String rawRequest, boolean head, long time, java.util.concurrent.TimeUnit unit) throws java.lang.Exception
Deprecated.Get a single response using a parser to search for the end of the message.- Parameters:
rawRequest
- The request to sendhead
- True if the response is for a head requesttime
- The time to waitunit
- The units of the wait- Returns:
- ByteBuffer containing response or null.
- Throws:
java.lang.Exception
- If there is a problem
-
-