Package xal.ca
Class BatchConnectionRequest
java.lang.Object
xal.ca.BatchConnectionRequest
BatchConnectionRequest
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
handle get request events -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add the specified listener as a receiver of batch connection request events from this instanceboolean
await
(double timeout) Wait up to the specified timeout for completion.void
cancel()
Cancel this request to stop monitoring and dispatching events.protected void
finalize()
dispose of the queueint
Get the number of channels requestedGet a copy of the channels to connectGet the channels that were connectedint
Get the number of channels that were connectedGet the channels that were connectedint
Get the number of channels that were connectedgetException
(Channel channel) get the exception if any for the specified channelint
Get the number of exceptionsGet the failed channelsGet the channels pending connectionboolean
Determine whether this request has been canceledboolean
Determine if there are any channels pending for either an exception or a completed get requestvoid
remove the specified listener from receiving batch connection request events from this instancevoid
submit()
submit this batch for processingboolean
submitAndWait
(double timeout) Submit a batch of get requests and wait for the requests to be completed or timeout.
-
Constructor Details
-
BatchConnectionRequest
Constructor- Parameters:
channels
- for which the connections will be requested
-
-
Method Details
-
finalize
dispose of the queue -
addBatchConnectionRequestListener
add the specified listener as a receiver of batch connection request events from this instance- Parameters:
listener
- to receive connection events
-
removeBatchConnectionRequestListener
remove the specified listener from receiving batch connection request events from this instance- Parameters:
listener
- to remove from receiving connection events
-
getChannels
Get a copy of the channels to connect- Returns:
- channels for which connections are requested
-
getChannelCount
public int getChannelCount()Get the number of channels requested- Returns:
- the number of channels for which connections are requested
-
getConnectedChannels
Get the channels that were connected- Returns:
- set of connected channels
-
getConnectedCount
public int getConnectedCount()Get the number of channels that were connected- Returns:
- the number of channels that were connected
-
getDisconnectedChannels
Get the channels that were connected- Returns:
- set of channels that were connected
-
getDisconnectedCount
public int getDisconnectedCount()Get the number of channels that were connected- Returns:
- the number of disconnected channels
-
getPendingChannels
Get the channels pending connection- Returns:
- set of channels that are pending connection
-
getException
get the exception if any for the specified channel- Parameters:
channel
- for which to get the exception if any- Returns:
- the exception for the specified channel or null if none
-
getFailedChannels
Get the failed channels- Returns:
- set of channels that failed to connect
-
getExceptionCount
public int getExceptionCount()Get the number of exceptions- Returns:
- the number of channels that had exceptions connecting
-
submit
public void submit()submit this batch for processing -
submitAndWait
public boolean submitAndWait(double timeout) Submit a batch of get requests and wait for the requests to be completed or timeout. Note that if this is called, within a channel access callback, requests will not be processed until the callback completes, so it is useless to wait. Instead, call waitForCompletion separately outside of the callback.- Parameters:
timeout
- the maximum time in seconds to wait for completion- Returns:
- true upon completion and false if not complete
-
await
public boolean await(double timeout) Wait up to the specified timeout for completion. This method may be called many times as needed.- Parameters:
timeout
- the maximum time in seconds to wait for completion- Returns:
- true upon completion and false if not complete
-
isCanceled
public boolean isCanceled()Determine whether this request has been canceled- Returns:
- true if canceled and false otherwise
-
cancel
public void cancel()Cancel this request to stop monitoring and dispatching events. -
isComplete
public boolean isComplete()Determine if there are any channels pending for either an exception or a completed get request- Returns:
- true if complete and false otherwise
-