Constructor and Description |
---|
SessionFuturesController(ISession session)
Constructs a future controller associated with the specified session
|
Modifier and Type | Method and Description |
---|---|
void |
abort(Throwable cause)
Notifies this controller about aborting registration.
|
void |
event(DataEvent event,
long length)
Notifies this controller about events related with I/O operations.
|
void |
event(SessionEvent event)
Notifies this controller about events related with changes of the
session state.
|
void |
exception(Throwable cause)
Notifies this controller about an failure.
|
IAbortableFuture<Void> |
getAbortableWriteFuture(long expectedSize)
Returns an abortable future that can be used to wait for the completion
of a write operation.
|
IFuture<Void> |
getCancelledFuture()
Returns a cancelled future.
|
IFuture<Void> |
getCloseFuture()
Returns the future that can be use to wait for the completion of the
session's closing phase.
|
IFuture<Void> |
getCreateFuture()
Returns the future that can be use to wait for the completion of the
session's creation phase.
|
IDelegatingFuture<Void> |
getDelegatingFuture()
Returns a future which can be represented by other delegate future.
|
IFuture<Void> |
getEndFuture()
Returns the future that can be use to wait for the completion of the
session's ending phase.
|
ITwoThresholdFuture<Void> |
getEngineWriteFuture(long expectedUnwrappedSize)
Returns a future that can be used to wait for the completion of write
operations from engine driven sessions.
|
IFuture<Void> |
getFailedFuture(Throwable cause)
Returns a failed future with the specified cause.
|
IFuture<Void> |
getOpenFuture()
Returns the future that can be use to wait for the completion of the
session's opening phase.
|
IFuture<Void> |
getReadyFuture()
Returns the future that can be use to wait for the completion of the
session's ready phase.
|
IFuture<Void> |
getSuccessfulFuture()
Returns a successful future.
|
IFuture<Void> |
getWriteFuture(long expectedSize)
Returns a future that can be used to wait for the completion of a write
operation.
|
void |
setExecutor(IFutureExecutor executor)
Sets the future executor that will be responsible for completion of the
operations related with the futures holden by this controller.
|
public SessionFuturesController(ISession session)
session
- the associated sessionpublic void setExecutor(IFutureExecutor executor)
executor
- the future executorpublic void event(SessionEvent event)
event
- an event related with a change of the session state.public void event(DataEvent event, long length)
event
- an event related with I/O operations.length
- the length of datapublic void exception(Throwable cause)
cause
- the cause of the failurepublic void abort(Throwable cause)
cause
- the cause of the failure, or null
if controlled
futures should be cancelledpublic final IFuture<Void> getCreateFuture()
public final IFuture<Void> getOpenFuture()
public final IFuture<Void> getReadyFuture()
public final IFuture<Void> getCloseFuture()
public final IFuture<Void> getEndFuture()
public IFuture<Void> getWriteFuture(long expectedSize)
expectedSize
- the expected size of total bytes sent by the future executor
that completes this futurepublic IAbortableFuture<Void> getAbortableWriteFuture(long expectedSize)
expectedSize
- the expected size of total bytes sent by the future executor
that completes this futurepublic ITwoThresholdFuture<Void> getEngineWriteFuture(long expectedUnwrappedSize)
expectedUnwrappedSize
- the expected unwrapped size of total bytes sent by the
future's executor that completes this futurepublic IFuture<Void> getCancelledFuture()
public IFuture<Void> getSuccessfulFuture()
public IFuture<Void> getFailedFuture(Throwable cause)
cause
- the cause of the failurepublic IDelegatingFuture<Void> getDelegatingFuture()
Copyright © 2017–2021 SNF4J.ORG. All rights reserved.