Class AbstractHttpClientTransport
- All Implemented Interfaces:
 HttpClient.Aware, HttpClientTransport, ClientConnectionFactory, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle, Invocable
- Direct Known Subclasses:
 AbstractConnectorHttpClientTransport, HttpClientTransportOverHTTP2, HttpClientTransportOverHTTP3
- 
Nested Class Summary
Nested classes/interfaces inherited from class AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface ClientConnectionFactory
ClientConnectionFactory.Decorator, ClientConnectionFactory.Info, ClientConnectionFactory.WrapperNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainer, Dumpable.DumpAppendableNested classes/interfaces inherited from interface Invocable
Invocable.Callable, Invocable.InvocationType, Invocable.ReadyTask, Invocable.TaskNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener - 
Field Summary
Fields inherited from interface ClientConnectionFactory
CONTEXT_KEYFields inherited from interface Invocable
__nonBlocking, NOOP - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected voidconnectFailed(Map<String, Object> context, Throwable failure) protected HttpClientvoidSet the factory for ConnectionPool instances.voidsetHttpClient(HttpClient client) Sets theHttpClientinstance on this transport.voidsetInvocationType(Invocable.InvocationType invocationType) Sets theInvocable.InvocationTypeassociated with thisHttpClientTransport.Methods inherited from class ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ClientConnectionFactory
customize, newConnectionMethods inherited from interface Container
getCachedBeans, getEventListenersMethods inherited from interface Dumpable.DumpableContainer
isDumpableMethods inherited from interface HttpClientTransport
connect, newDestination, newOrigin 
- 
Constructor Details
- 
AbstractHttpClientTransport
public AbstractHttpClientTransport() 
 - 
 - 
Method Details
- 
getHttpClient
 - 
setHttpClient
Description copied from interface:HttpClientTransportSets theHttpClientinstance on this transport.This is needed because of a chicken-egg problem: in order to create the
HttpClienta HttpClientTransport is needed, that therefore cannot have a reference yet to theHttpClient.- Specified by:
 setHttpClientin interfaceHttpClient.Aware- Specified by:
 setHttpClientin interfaceHttpClientTransport- Parameters:
 client- theHttpClientthat uses this transport.
 - 
getConnectionPoolFactory
- Specified by:
 getConnectionPoolFactoryin interfaceHttpClientTransport- Returns:
 - the factory for ConnectionPool instances
 
 - 
setConnectionPoolFactory
Description copied from interface:HttpClientTransportSet the factory for ConnectionPool instances.- Specified by:
 setConnectionPoolFactoryin interfaceHttpClientTransport- Parameters:
 factory- the factory for ConnectionPool instances
 - 
connectFailed
 - 
getInvocationType
- Specified by:
 getInvocationTypein interfaceHttpClientTransport- Specified by:
 getInvocationTypein interfaceInvocable- Returns:
 - the 
Invocable.InvocationTypeassociated with thisHttpClientTransport. - See Also:
 
 - 
setInvocationType
Description copied from interface:HttpClientTransportSets the
Invocable.InvocationTypeassociated with thisHttpClientTransport.The values are typically either:
Invocable.InvocationType.BLOCKING, to indicate that response listeners are executing blocking code, for example blocking network I/O, JDBC, etc.Invocable.InvocationType.NON_BLOCKING, to indicate that response listeners are executing non-blocking code.
By default, the value is
Invocable.InvocationType.BLOCKING.A response listener declared to be
Invocable.InvocationType.BLOCKINGincurs in one additional context switch, where the NIO processing thread delegates the response processing to another thread. This ensures that the NIO processing thread can immediately continue with other NIO processing activities, if any (for example, processing another connection). This also means that processing of different connections is parallelized.Invocable.InvocationType.BLOCKINGmust be used when you want response listeners to be invoked by virtual threads.On the other hand, a response listener declared to be
Invocable.InvocationType.NON_BLOCKINGdoes not incur in the additional context switch, and therefore it is potentially more efficient. However, the processing of different connections is serialized, which means that the last connection will be processed only after the previous connections (and their respective response listeners) have been processed.A response listener declared to be
Invocable.InvocationType.NON_BLOCKING, but then executing blocking code, will block the NIO processing performed byHttpClient's implementation: the current connection and possibly other connections will not be further processed, until the blocking response listener returns.- Specified by:
 setInvocationTypein interfaceHttpClientTransport- Parameters:
 invocationType- theInvocable.InvocationTypeassociated with thisHttpClientTransport.- See Also:
 
 
 -