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:
DuplexHttpDestination,MultiplexHttpDestination
@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 ClassesNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested 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.InvocationType, org.eclipse.jetty.util.thread.Invocable.ReadyTask, org.eclipse.jetty.util.thread.Invocable.TaskNested 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, 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
ConstructorsConstructorDescriptionHttpDestination(HttpClient client, Origin origin, boolean intrinsicallySecure) -
Method Summary
Modifier and TypeMethodDescriptionvoidAborts all theHttpExchanges queued in this destination.voidaccept(Connection connection) asString()voidclose()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) voidorg.eclipse.jetty.io.ClientConnectionFactorygetHost()org.eclipse.jetty.http.HttpFieldlonggetIdle()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 org.eclipse.jetty.io.ClientConnectionFactorynewSslClientConnectionFactory(org.eclipse.jetty.util.ssl.SslContextFactory.Client sslContextFactory, org.eclipse.jetty.io.ClientConnectionFactory connectionFactory) voidrelease(Connection connection) booleanremove(Connection connection) booleanremove(HttpExchange exchange) voidsend()voidsend(Request request, Response.CompleteListener listener) voidsend(HttpExchange exchange) protected voidsend(HttpRequest request, List<Response.ResponseListener> listeners) protected SendFailuresend(IConnection connection, HttpExchange exchange) booleanstale()voidbooleansweep()toString()Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, 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.Callback
completeWithMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods 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
-
accept
-
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
protected org.eclipse.jetty.io.ClientConnectionFactory newSslClientConnectionFactory(org.eclipse.jetty.util.ssl.SslContextFactory.Client sslContextFactory, org.eclipse.jetty.io.ClientConnectionFactory connectionFactory) -
isSecure
public boolean isSecure() -
getHttpClient
-
getOrigin
-
getHttpExchanges
-
getRequestNotifier
-
getResponseNotifier
-
getProxy
-
getClientConnectionFactory
public org.eclipse.jetty.io.ClientConnectionFactory 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
public org.eclipse.jetty.http.HttpField 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
-
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
-