Top Description Fields Constructors Methods
org.apache.hc.core5.http.impl.bootstrap

public Class AsyncRequester

extends AbstractConnectionInitiatorBase
implements IOReactorService
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.reactor.IOReactorService, org.apache.hc.core5.reactor.IOReactor, org.apache.hc.core5.io.ModalCloseable, java.io.Closeable, java.lang.AutoCloseable
Known Direct Subclasses
org.apache.hc.core5.http.impl.bootstrap.HttpAsyncRequester
Imports
java.io.IOException, java.net.InetSocketAddress, java.util.concurrent.Future, org.apache.hc.core5.annotation.Internal, org.apache.hc.core5.concurrent.DefaultThreadFactory, .FutureCallback, org.apache.hc.core5.function.Callback, .Decorator, .Resolver, org.apache.hc.core5.http.HttpHost, org.apache.hc.core5.http.impl.DefaultAddressResolver, org.apache.hc.core5.io.CloseMode, org.apache.hc.core5.reactor.ConnectionInitiator, .DefaultConnectingIOReactor, .IOEventHandlerFactory, .IOReactorConfig, .IOReactorService, .IOReactorStatus, .IOSession, .IOSessionListener, org.apache.hc.core5.util.Args, .TimeValue, .Timeout

Protocol agnostic client side I/O session initiator.
Since
5.0

Field Summary

Modifier and TypeField and Description
private final Resolver<HttpHost, InetSocketAddress>
private final DefaultConnectingIOReactor

Constructor Summary

AccessConstructor and Description
public
AsyncRequester(final IOEventHandlerFactory eventHandlerFactory, final IOReactorConfig ioReactorConfig, final Decorator<IOSession> ioSessionDecorator, final Callback<Exception> exceptionCallback, final IOSessionListener sessionListener, final Callback<IOSession> sessionShutdownCallback, final Resolver<HttpHost, InetSocketAddress> addressResolver)

Method Summary

Modifier and TypeMethod and Description
public void
awaitShutdown(final TimeValue
wait time.
waitTime
)

Implements org.apache.hc.core5.reactor.IOReactor.awaitShutdown.

Blocks for the given period of time in milliseconds awaiting the completion of the reactor shutdown.
public void
close(final CloseMode
How to close the receiver.
closeMode
)

Implements org.apache.hc.core5.reactor.IOReactor.close.

Shuts down the I/O reactor either gracefully or immediately.
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.
pack-priv ConnectionInitiator
public IOReactorStatus
getStatus()

Implements org.apache.hc.core5.reactor.IOReactor.getStatus.

Returns the current status of the reactor.
public void
initiateShutdown()

Implements org.apache.hc.core5.reactor.IOReactor.initiateShutdown.

Initiates shutdown of the reactor without blocking.
public Future<IOSession>
requestSession(final HttpHost host, final Timeout timeout, final Object attachment, final FutureCallback<IOSession> callback)

public void
Inherited from org.apache.hc.core5.http.impl.bootstrap.AbstractConnectionInitiatorBase:
connect

Field Detail

addressResolverback to summary
private final Resolver<HttpHost, InetSocketAddress> addressResolver
ioReactorback to summary
private final DefaultConnectingIOReactor ioReactor

Constructor Detail

AsyncRequesterback to summary
public AsyncRequester(final IOEventHandlerFactory eventHandlerFactory, final IOReactorConfig ioReactorConfig, final Decorator<IOSession> ioSessionDecorator, final Callback<Exception> exceptionCallback, final IOSessionListener sessionListener, final Callback<IOSession> sessionShutdownCallback, final Resolver<HttpHost, InetSocketAddress> addressResolver)
Annotations
@Internal

Method Detail

awaitShutdownback to summary
public void awaitShutdown(final TimeValue waitTime) throws InterruptedException

Implements org.apache.hc.core5.reactor.IOReactor.awaitShutdown.

Doc from org.apache.hc.core5.reactor.IOReactor.awaitShutdown.

Blocks for the given period of time in milliseconds awaiting the completion of the reactor shutdown.

Parameters
waitTime:TimeValue

wait time.

Annotations
@Override
closeback to summary
public void close(final CloseMode closeMode)

Implements org.apache.hc.core5.reactor.IOReactor.close.

Doc from org.apache.hc.core5.reactor.IOReactor.close.

Shuts down the I/O reactor either gracefully or immediately. During graceful shutdown individual I/O sessions should be informed about imminent termination and be given a grace period to complete the ongoing I/O sessions. During immediate shutdown all ongoing I/O sessions get aborted immediately.

Parameters
closeMode:CloseMode

Doc from org.apache.hc.core5.io.ModalCloseable.close.

How to close the receiver.

Annotations
@Override
closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
getIOReactorback to summary
pack-priv ConnectionInitiator getIOReactor()

Implements abstract org.apache.hc.core5.http.impl.bootstrap.AbstractConnectionInitiatorBase.getIOReactor.

Annotations
@Override
getStatusback to summary
public IOReactorStatus getStatus()

Implements org.apache.hc.core5.reactor.IOReactor.getStatus.

Doc from org.apache.hc.core5.reactor.IOReactor.getStatus.

Returns the current status of the reactor.

Returns:IOReactorStatus

reactor status.

Annotations
@Override
initiateShutdownback to summary
public void initiateShutdown()

Implements org.apache.hc.core5.reactor.IOReactor.initiateShutdown.

Doc from org.apache.hc.core5.reactor.IOReactor.initiateShutdown.

Initiates shutdown of the reactor without blocking. The reactor is expected to terminate all active connections, to shut down itself and to release system resources it currently holds

Annotations
@Override
requestSessionback to summary
public Future<IOSession> requestSession(final HttpHost host, final Timeout timeout, final Object attachment, final FutureCallback<IOSession> callback)
startback to summary
public void start()

Implements org.apache.hc.core5.reactor.IOReactorService.start.

Doc from org.apache.hc.core5.reactor.IOReactorService.start.

Starts I/O reactor.

Annotations
@Override