Class ProcessStatus
java.lang.Object
utils.communication.groupConstitution.Process
utils.communication.groupConstitution.ProcessStatus
- All Implemented Interfaces:
ProcessInterface
,Closeable
,AutoCloseable
,AsynchronousChannel
,Channel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
complete
(double vOnCompletion, int completionRound) boolean
isActive()
boolean
boolean
isOther()
Whether this GroupMember represents another process or ourselves.process()
void
reset()
<T> void
safeRead
(ByteBuffer bf, T attachment, CompletionHandler<Integer, ? super T> handler) Asynchronous thread-safe read method.<T> void
safeWrite
(ByteBuffer bf, T attachment, CompletionHandler<Integer, ? super T> handler) Asynchronous thread-safe write method.void
setActive
(boolean active) Methods inherited from class utils.communication.groupConstitution.Process
close, connect, getRemoteAddress, isFaulty, isOpen, isReadable, isWriteable, markAsFaulty, markAsFaulty, safeWrite, shallowClone
-
Constructor Details
-
ProcessStatus
-
ProcessStatus
-
-
Method Details
-
process
-
isCompleted
public boolean isCompleted() -
isActive
public boolean isActive() -
setActive
public void setActive(boolean active) -
getvOnCompletion
-
isOther
public boolean isOther()Description copied from interface:ProcessInterface
Whether this GroupMember represents another process or ourselves.- Specified by:
isOther
in interfaceProcessInterface
- Overrides:
isOther
in classProcess
- Returns:
- True if it is not the calling process, false otherwise
-
complete
public void complete(double vOnCompletion, int completionRound) -
reset
public void reset() -
safeWrite
public <T> void safeWrite(ByteBuffer bf, T attachment, CompletionHandler<Integer, ? super T> handler) Description copied from interface:ProcessInterface
Asynchronous thread-safe write method. Guarantees no WritePendingException occurs. Does nothing in the case that isOther is false.- Specified by:
safeWrite
in interfaceProcessInterface
- Overrides:
safeWrite
in classProcess
- Type Parameters:
T
- Type of attachment- Parameters:
bf
- The buffer from which bytes are to be transferredattachment
- The object to attach to the I/O operationhandler
- The handler for consuming the result
-
safeRead
Description copied from interface:ProcessInterface
Asynchronous thread-safe read method. Does nothing in the case that isOther is false.- Specified by:
safeRead
in interfaceProcessInterface
- Overrides:
safeRead
in classProcess
- Type Parameters:
T
- Type of attachment- Parameters:
bf
- The buffer to which bytes are to be transferredattachment
- The object to attach to the I/O operationhandler
- The handler for consuming the result
-