Interface Action

  • All Superinterfaces:
    java.lang.Runnable
    All Known Implementing Classes:
    CancelAction, ExecuteAction

    interface Action
    extends java.lang.Runnable
    The Action object is used to represent an action that the distributor is to process. This contains the operation and the required I/O events as an integer bit mask. When an operation is considered ready it will be handed to an executor to execute.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.nio.channels.SelectableChannel getChannel()
      This is the SelectableChannel which is used to determine if the operation should be executed.
      long getExpiry()
      This is used to get the expiry for the operation.
      int getInterest()
      This returns the I/O operations that the action is interested in as an integer bit mask.
      Operation getOperation()
      This is used to acquire the Operation that is to be executed when the required operations are ready.
      • Methods inherited from interface java.lang.Runnable

        run
    • Method Detail

      • getExpiry

        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.
        Returns:
        the remaining time this operation will wait for
      • getInterest

        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.
        Returns:
        the integer bit mask of interested I/O operations
      • getChannel

        java.nio.channels.SelectableChannel getChannel()
        This is the SelectableChannel which 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.
        Returns:
        this returns the channel used to govern execution
      • getOperation

        Operation getOperation()
        This is used to acquire the Operation that is to be executed when the required operations are ready. It is the responsibility of the distributor to invoke the operation.
        Returns:
        the operation to be executed when it is ready