Package COM.activesw.api.client
Class BrokerClientPoll
java.lang.Object
COM.activesw.api.client.BrokerClientPoll
This class is a data structure used to describe client poll information.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBrokerClientPoll
(BrokerClient client, int requested, Object data) Create a client poll object. -
Method Summary
Modifier and TypeMethodDescriptionGet the Broker client.getData()
Get user data.int
getReady()
Get the poll's ready operations.int
Get the poll's requested operations.boolean
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.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.
-
Field Details
-
GET_EVENTS
public static final int GET_EVENTSOperation bit for "get events".This operation is ready when BrokerClient.isClientPending() returns true from within BrokerClient.poll().
- See Also:
-
-
Constructor Details
-
BrokerClientPoll
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
Get the Broker client.- Returns:
- The Broker client.
-
setBrokerClient
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
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
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
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
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
Set user data.- Parameters:
data
- The user data; may be null.- Returns:
- The old user data, if any, or null.
-
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.
-