|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.link.ILnkPeerEndpoint.FlushContext
com.neeve.link.ILnkPeerEndpoint.AsynchronousFlushContext
public static final class ILnkPeerEndpoint.AsynchronousFlushContext
Context for asynchronous flushing through a peer endpoint..
The user provides an instance of this class to the ILnkPeerEndpoint.enque(short, com.neeve.pkt.PktPacket, com.neeve.link.ILnkPeerEndpoint.FlushContext, int)
and
ILnkPeerEndpoint.flush(short, com.neeve.link.ILnkPeerEndpoint.FlushContext)
methods to request for asynchronous flush semantics. In
case the enque method did not flush the endpoint, none of the fields
in this context are altered. In case the endpoint was flushed (implictly
via the enque method or explicitly via the flush method) and the
flush completed synchronously, the syncComplete
flag is set.
In case the flush could not complete synchronously, the inProgress
flag is set to indicate that the flush has been scheduled for background
completion. In such a case, the user is responsible for driving the
dispatcher
to drive the flush to
completion. Upon completion of the flush, the inProgress flag
is reset and the LnkEvents.EVENT_FLUSH_COMPLETE
event is
dispatched to the users registered event handler.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.neeve.link.ILnkPeerEndpoint.FlushContext |
---|
ILnkPeerEndpoint.FlushContext.FlushMode |
Field Summary | |
---|---|
IEmxDispatcher |
dispatcher
[IN] The dispatcher to use in case the flush is to be scheduled for asynchronous completion. |
boolean |
inProgress
[OUT] Indicates whether the flush was scheduled for asynchronous completion. |
Exception |
status
[OUT] Contains the status of the flush completion. |
boolean |
syncComplete
[OUT] Indicates whether the flush completed synchronously or not. |
Fields inherited from class com.neeve.link.ILnkPeerEndpoint.FlushContext |
---|
flushMode |
Constructor Summary | |
---|---|
ILnkPeerEndpoint.AsynchronousFlushContext(IEmxDispatcher dispatcher)
Construct using a dispatcher. |
Method Summary | |
---|---|
void |
reset()
Implemented FlushContext method. |
void |
setDispatcher(IEmxDispatcher dispatcher)
Reset the flush context dispatcher. |
String |
toString()
String representation. |
Methods inherited from class com.neeve.link.ILnkPeerEndpoint.FlushContext |
---|
getAttachment, setAttachment |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public volatile IEmxDispatcher dispatcher
The dispatcher in which context the flush will be submitted for
asynchronous completion in case the flush cannot be completed
synchronously. Upon return from the enque or flush method, in
case the inProgress
flag is set, the user needs to drive
the dispatcher to drive the flush to completion. Upon completion
of the flush, the inProgress
flag is reset and the
flush complete event dispatched to the user's registered event
handler.
public volatile boolean inProgress
Upon return from the enque or flush method, this flag will be set in case the method attempted the flush, could not complete it synchronously and has scheduled it for asynchronous completion. If set, te user needs to drive the provided dispatcher until the flush completes i.e. the flush completion event is dispatched and/or this flag is reset.
public volatile boolean syncComplete
Upon return from the enque or flush method, this flag will be set if the method flushed the endpoint and the flush completed synchronously. If set to false, it indicates that either the flush was not initiated or was initiated and is completing asynchronously. The user can differentiate between these two cases by inspecting the inProgress flag. The inProgress flag will be set in the latter case. This flag is always set to false when the flush completion event is dispatched.
public volatile Exception status
Constructor Detail |
---|
public ILnkPeerEndpoint.AsynchronousFlushContext(IEmxDispatcher dispatcher)
Method Detail |
---|
public final void setDispatcher(IEmxDispatcher dispatcher)
public final void reset()
reset
in class ILnkPeerEndpoint.FlushContext
public final String toString()
toString
in class ILnkPeerEndpoint.FlushContext
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |