public class BatchConnectionRequest
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
BatchConnectionRequest.RequestHandler
handle get request events
|
Constructor and Description |
---|
BatchConnectionRequest(java.util.Collection<Channel> channels)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addBatchConnectionRequestListener(BatchConnectionRequestListener listener)
add the specified listener as a receiver of batch connection request events from this instance
|
boolean |
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 queue
|
int |
getChannelCount()
Get the number of channels requested
|
java.util.Set<Channel> |
getChannels()
Get a copy of the channels to connect
|
java.util.Set<Channel> |
getConnectedChannels()
Get the channels that were connected
|
int |
getConnectedCount()
Get the number of channels that were connected
|
java.util.Set<Channel> |
getDisconnectedChannels()
Get the channels that were connected
|
int |
getDisconnectedCount()
Get the number of channels that were connected
|
java.lang.Exception |
getException(Channel channel)
get the exception if any for the specified channel
|
int |
getExceptionCount()
Get the number of exceptions
|
java.util.Set<Channel> |
getFailedChannels()
Get the failed channels
|
java.util.Set<Channel> |
getPendingChannels()
Get the channels pending connection
|
boolean |
isCanceled()
Determine whether this request has been caceled
|
boolean |
isComplete()
Determine if there are any channels pending for either an exception or a completed get request
|
void |
removeBatchConnectionRequestListener(BatchConnectionRequestListener listener)
remove the specified listener from receiving batch connection request events from this instance
|
void |
submit()
submit this batch for processing
|
boolean |
submitAndWait(double timeout)
Submit a batch of get requests and wait for the requests to be completed or timeout.
|
public BatchConnectionRequest(java.util.Collection<Channel> channels)
channels
- for which the connections will be requrestedprotected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void addBatchConnectionRequestListener(BatchConnectionRequestListener listener)
listener
- to receive connection eventspublic void removeBatchConnectionRequestListener(BatchConnectionRequestListener listener)
listener
- to remove from receiving connection eventspublic java.util.Set<Channel> getChannels()
public int getChannelCount()
public java.util.Set<Channel> getConnectedChannels()
public int getConnectedCount()
public java.util.Set<Channel> getDisconnectedChannels()
public int getDisconnectedCount()
public java.util.Set<Channel> getPendingChannels()
public java.lang.Exception getException(Channel channel)
channel
- for which to get the exception if anypublic java.util.Set<Channel> getFailedChannels()
public int getExceptionCount()
public void submit()
public boolean submitAndWait(double timeout)
timeout
- the maximum time in seconds to wait for completionpublic boolean await(double timeout)
timeout
- the maximum time in seconds to wait for completionpublic boolean isCanceled()
public void cancel()
public boolean isComplete()