Class ExecuteAction
java.lang.Object
org.simpleframework.transport.reactor.ExecuteAction
The
ExecuteAction object is represents an action
that the distributor is to process. This contains the operation
and the required I/O events as an integer bit mask as well as the
selectable channel used to register for selection. In order to
ensure that the action does not remain within the distributor for
too long the action has an expiry time.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExecuteAction(Operation task, int require, long expiry) Constructor for theEventobject. -
Method Summary
Modifier and TypeMethodDescriptionThis is theSelectableChannelwhich is used to determine if the operation should be executed.longThis is used to get the expiry for the operation.intThis returns the I/O operations that the action is interested in as an integer bit mask.This is used to acquire theOperationthat is to be executed when the required operations are ready.voidrun()This is used to execute the operation for the action.
-
Field Details
-
task
The task to execute when the required operations is ready. -
require
private final int requireThis is the bit mask of required operations to be executed. -
expiry
private final long expiryThis is the time in the future that the event will expire in.
-
-
Constructor Details
-
ExecuteAction
Constructor for theEventobject. The actions are used to encapsulate the task to execute and the operations to listen to when some action is to be performed.- Parameters:
task- this is the task to be executed when it is readyrequire- this is the required operations to listen to
-
-
Method Details
-
run
public void run()This is used to execute the operation for the action. This will be executed when the interested I/O event is ready for the associatedSelectableChannelobject. If the action expires before the interested I/O operation is ready this will not be executed, instead the operation is canceled. -
getExpiry
public long getExpiry()This is used to get the expiry for the operation. The expiry represents some static time in the future when the action will expire if it does not become ready. This is used to cancel the operation so that it does not remain in the distributor. -
getChannel
This is theSelectableChannelwhich is used to determine if the operation should be executed. If the channel is ready for a given I/O event it can be run. For instance if the operation is used to perform some form of read operation it can be executed when ready to read data from the channel.- Specified by:
getChannelin interfaceAction- Returns:
- this returns the channel used to govern execution
-
getOperation
This is used to acquire theOperationthat is to be executed when the required operations are ready. It is the responsibility of the distributor to invoke the operation.- Specified by:
getOperationin interfaceAction- Returns:
- the operation to be executed when it is ready
-
getInterest
public int getInterest()This returns the I/O operations that the action is interested in as an integer bit mask. When any of these operations are ready the distributor will execute the provided operation.- Specified by:
getInterestin interfaceAction- Returns:
- the integer bit mask of interested I/O operations
-