Package org.eclipse.jetty.client
Class HttpDestination
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.client.HttpDestination
- All Implemented Interfaces:
Closeable,AutoCloseable,Destination,org.eclipse.jetty.util.Callback,org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.Dumpable.DumpableContainer,org.eclipse.jetty.util.component.LifeCycle,org.eclipse.jetty.util.thread.Invocable,org.eclipse.jetty.util.thread.Sweeper.Sweepable
- Direct Known Subclasses:
MultiplexHttpDestination,PoolingHttpDestination
@ManagedObject
public abstract class HttpDestination
extends org.eclipse.jetty.util.component.ContainerLifeCycle
implements Destination, Closeable, org.eclipse.jetty.util.Callback, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.thread.Sweeper.Sweepable
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.Callback
org.eclipse.jetty.util.Callback.Completable, org.eclipse.jetty.util.Callback.Completing, org.eclipse.jetty.util.Callback.NestedNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
org.eclipse.jetty.util.thread.Invocable.InvocationTypeNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.Callback
NOOPFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEYFields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAborts all theHttpExchanges queued in this destination.asString()voidclose()voidclose(Connection connection) Deprecated.protected voidcreateConnection(org.eclipse.jetty.util.Promise<Connection> promise) protected voiddoStart()protected voiddoStop()voiddump(Appendable out, String indent) protected booleanenqueue(Queue<HttpExchange> queue, HttpExchange exchange) voidgetHost()longgetIdle()intgetPort()getProxy()intbooleanisSecure()booleanisStale()voidnewConnection(org.eclipse.jetty.util.Promise<Connection> promise) Creates asynchronously a new, unpooled,Connectionthat will be returned at a later time through the givenPromise.protected ConnectionPoolnewConnectionPool(HttpClient client) protected Queue<HttpExchange>newExchangeQueue(HttpClient client) protected ClientConnectionFactorynewSslClientConnectionFactory(ClientConnectionFactory connectionFactory) Deprecated.protected ClientConnectionFactorynewSslClientConnectionFactory(org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory, ClientConnectionFactory connectionFactory) voidrelease(Connection connection) booleanremove(Connection connection) booleanremove(HttpExchange exchange) voidsend()protected abstract SendFailuresend(Connection connection, HttpExchange exchange) voidsend(Request request, Response.CompleteListener listener) voidsend(HttpExchange exchange) protected voidsend(HttpRequest request, List<Response.ResponseListener> listeners) booleanstale()voidbooleansweep()toString()Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dump, dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.util.thread.Invocable
getInvocationType
-
Constructor Details
-
HttpDestination
-
-
Method Details
-
stale
public boolean stale() -
sweep
public boolean sweep()- Specified by:
sweepin interfaceorg.eclipse.jetty.util.thread.Sweeper.Sweepable
-
doStart
- Overrides:
doStartin classorg.eclipse.jetty.util.component.ContainerLifeCycle- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.eclipse.jetty.util.component.ContainerLifeCycle- Throws:
Exception
-
newConnectionPool
-
newExchangeQueue
-
newSslClientConnectionFactory
@Deprecated protected ClientConnectionFactory newSslClientConnectionFactory(ClientConnectionFactory connectionFactory) Deprecated.Creates a newSslClientConnectionFactorywrapping the given connection factory.- Parameters:
connectionFactory- the connection factory to wrap- Returns:
- a new SslClientConnectionFactory
-
newSslClientConnectionFactory
protected ClientConnectionFactory newSslClientConnectionFactory(org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory, ClientConnectionFactory connectionFactory) -
isSecure
public boolean isSecure() -
getHttpClient
-
getOrigin
-
getHttpExchanges
-
getRequestNotifier
-
getResponseNotifier
-
getProxy
-
getClientConnectionFactory
-
getScheme
- Specified by:
getSchemein interfaceDestination- Returns:
- the scheme of this destination, such as "http" or "https"
-
getHost
- Specified by:
getHostin interfaceDestination- Returns:
- the host of this destination, such as "127.0.0.1" or "google.com"
-
getPort
@ManagedAttribute(value="The destination port", readonly=true) public int getPort()- Specified by:
getPortin interfaceDestination- Returns:
- the port of this destination such as 80 or 443
-
getQueuedRequestCount
@ManagedAttribute(value="The number of queued requests", readonly=true) public int getQueuedRequestCount() -
getConnectAddress
-
getHostField
-
getConnectionPool
@ManagedAttribute(value="The connection pool", readonly=true) public ConnectionPool getConnectionPool() -
succeeded
public void succeeded()- Specified by:
succeededin interfaceorg.eclipse.jetty.util.Callback
-
failed
- Specified by:
failedin interfaceorg.eclipse.jetty.util.Callback
-
send
-
send
-
send
-
enqueue
-
send
public void send() -
send
-
newConnection
Description copied from interface:DestinationCreates asynchronously a new, unpooled,Connectionthat will be returned at a later time through the givenPromise.Use
FuturePromiseto wait for the connection:Destination destination = ...; FuturePromise<Connection> futureConnection = new FuturePromise<>(); destination.newConnection(futureConnection); Connection connection = futureConnection.get(5, TimeUnit.SECONDS);
- Specified by:
newConnectionin interfaceDestination- Parameters:
promise- the promise of a new, unpooled,Connection
-
createConnection
-
remove
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
release
-
remove
-
close
Deprecated.useremove(Connection)instead- Parameters:
connection- the connection to remove
-
abort
Aborts all theHttpExchanges queued in this destination.- Parameters:
cause- the abort cause
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Overrides:
dumpin classorg.eclipse.jetty.util.component.ContainerLifeCycle- Throws:
IOException
-
asString
-
getIdle
@ManagedAttribute("For how long this destination has been idle in ms") public long getIdle() -
isStale
@ManagedAttribute("Whether this destinations is stale") public boolean isStale() -
toString
- Overrides:
toStringin classorg.eclipse.jetty.util.component.AbstractLifeCycle
-
remove(Connection)instead