Class BrokerClientPoll


  • public class BrokerClientPoll
    extends java.lang.Object
    This class is a data structure used to describe client poll information.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int GET_EVENTS
      Operation bit for "get events".
    • Constructor Summary

      Constructors 
      Constructor Description
      BrokerClientPoll​(BrokerClient client, int requested, java.lang.Object data)
      Create a client poll object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      BrokerClient getBrokerClient()
      Get the Broker client.
      java.lang.Object getData()
      Get user data.
      int getReady()
      Get the poll's ready operations.
      int getRequested()
      Get the poll's requested operations.
      boolean getSuspend()
      Get the suspend state of this poll object.
      boolean isReady​(int operations)
      Check if operations are ready.
      boolean isRequested​(int operations)
      Check if operations are requested.
      void setBrokerClient​(BrokerClient client)
      Set the Broker client.
      java.lang.Object setData​(java.lang.Object data)
      Set user data.
      protected void setReady​(int ready)
      Set the poll's ready operations.
      protected void setRequested​(int requested)
      Set the poll's requested operations.
      void setSuspend​(boolean suspend)
      Suspend or unsuspend this poll object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • GET_EVENTS

        public static final int GET_EVENTS
        Operation bit for "get events".

        This operation is ready when BrokerClient.isClientPending() returns true from within BrokerClient.poll().

        See Also:
        Constant Field Values
    • Constructor Detail

      • BrokerClientPoll

        public BrokerClientPoll​(BrokerClient client,
                                int requested,
                                java.lang.Object data)
                         throws BrokerException
        Create a client poll object. The client poll object is passed to BrokerClient.poll() and returned when any of the requested operations are ready.

        Note: Calling BrokerClient.poll on the same BrokerClientPoll object in multiple threads is not supported.

        Parameters:
        client - The client to poll.
        requested - The requested operations.
        data - The user data; may be null.
        Throws:
        BrokerNullParameterException - If client is null.
        BrokerInvalidPollOperationException - if a requested operation is invalid.
        BrokerException
    • Method Detail

      • getBrokerClient

        public BrokerClient getBrokerClient()
        Get the Broker client.
        Returns:
        The Broker client.
      • getRequested

        public int getRequested()
        Get the poll's requested operations.
        Returns:
        The requested operations.
      • getReady

        public int getReady()
        Get the poll's ready operations.
        Returns:
        The ready operations.
      • setData

        public java.lang.Object setData​(java.lang.Object data)
        Set user data.
        Parameters:
        data - The user data; may be null.
        Returns:
        The old user data, if any, or null.
      • getData

        public java.lang.Object getData()
        Get user data.
        Returns:
        The user data, if any, or null.
      • setSuspend

        public void setSuspend​(boolean suspend)
        Suspend or unsuspend this poll object. When suspended this poll object will not be polled when passed to BrokerClient.poll.
        Parameters:
        suspend - true to temporarily suspend polling of this object, false to resume polling.
      • getSuspend

        public boolean getSuspend()
        Get the suspend state of this poll object.
        Returns:
        true if this poll object is suspended.