Package xal.ca

Class BatchConnectionRequest

java.lang.Object
xal.ca.BatchConnectionRequest

public class BatchConnectionRequest extends Object
BatchConnectionRequest
  • Constructor Details

    • BatchConnectionRequest

      public BatchConnectionRequest(Collection<Channel> channels)
      Constructor
      Parameters:
      channels - for which the connections will be requested
  • Method Details

    • finalize

      protected void finalize() throws Throwable
      dispose of the queue
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • addBatchConnectionRequestListener

      public void addBatchConnectionRequestListener(BatchConnectionRequestListener listener)
      add the specified listener as a receiver of batch connection request events from this instance
      Parameters:
      listener - to receive connection events
    • removeBatchConnectionRequestListener

      public void removeBatchConnectionRequestListener(BatchConnectionRequestListener listener)
      remove the specified listener from receiving batch connection request events from this instance
      Parameters:
      listener - to remove from receiving connection events
    • getChannels

      public Set<Channel> 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

      public Set<Channel> 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

      public Set<Channel> 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

      public Set<Channel> getPendingChannels()
      Get the channels pending connection
      Returns:
      set of channels that are pending connection
    • getException

      public Exception getException(Channel channel)
      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

      public Set<Channel> 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