Package org.km3net.clb.remote.msg
Class ResponseQueue<T>
- java.lang.Object
-
- org.km3net.clb.remote.msg.ResponseQueue<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
ResponseHandler<T>
public class ResponseQueue<T> extends java.lang.Object implements ResponseHandler<T>
ResponseQueue is an asynchronous queue.
-
-
Constructor Summary
Constructors Constructor Description ResponseQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Response<T>peek()Response<T>poll()Response<T>poll(long timeout, java.util.concurrent.TimeUnit unit)voidq(Response<T> resp)intqueueSize()voidresponseException(Response<T> r, java.lang.Exception e)Invoked when a command resulted in an exception.voidresponseValue(Response<T> r, T value)Invoked when a response arrives.intresultsPending()Response<T>take()
-
-
-
Method Detail
-
responseValue
public void responseValue(Response<T> r, T value)
Description copied from interface:ResponseHandlerInvoked when a response arrives.- Specified by:
responseValuein interfaceResponseHandler<T>- Parameters:
r- The response object which issues the eventvalue- The value of the response.
-
responseException
public void responseException(Response<T> r, java.lang.Exception e)
Description copied from interface:ResponseHandlerInvoked when a command resulted in an exception.- Specified by:
responseExceptionin interfaceResponseHandler<T>- Parameters:
r- The response object which issues the evente- The exception.
-
resultsPending
public int resultsPending()
-
queueSize
public int queueSize()
-
poll
public Response<T> poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
-