Class BrokerClientPoll

java.lang.Object
COM.activesw.api.client.BrokerClientPoll

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

    • 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:
  • Constructor Details

    • BrokerClientPoll

      public BrokerClientPoll(BrokerClient client, int requested, 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.
      COM.activesw.api.client.BrokerInvalidPollOperationException - if a requested operation is invalid.
      BrokerException
  • Method Details

    • getBrokerClient

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

      public void setBrokerClient(BrokerClient client) throws BrokerException
      Set the Broker client. The BrokerClientPoll object must be suspended in order to set the Broker client.
      Parameters:
      client - The Broker client.
      Throws:
      BrokerNullParameterException - If client is null.
      BrokerException
    • getRequested

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

      protected void setRequested(int requested) throws BrokerException
      Set the poll's requested operations.
      Parameters:
      requested - The requested operations.
      Throws:
      COM.activesw.api.client.BrokerInvalidPollOperationException - if a requested operation is invalid.
      BrokerException
    • isRequested

      public boolean isRequested(int operations) throws BrokerException
      Check if operations are requested.
      Parameters:
      operations - The operation(s) to check.
      Returns:
      true if the operation is requested.
      Throws:
      COM.activesw.api.client.BrokerInvalidPollOperationException - if a requested operation is invalid.
      BrokerException
    • getReady

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

      protected void setReady(int ready) throws BrokerException
      Set the poll's ready operations.
      Parameters:
      ready - The ready operations.
      Throws:
      COM.activesw.api.client.BrokerInvalidPollOperationException - if a requested operation is invalid.
      BrokerException
    • isReady

      public boolean isReady(int operations) throws BrokerException
      Check if operations are ready.
      Parameters:
      operations - The operation(s) to check.
      Returns:
      true if the operation is requested.
      Throws:
      COM.activesw.api.client.BrokerInvalidPollOperationException - if a requested operation is invalid.
      BrokerException
    • setData

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

      public 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.