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)
void
q(Response<T> resp)
int
queueSize()
void
responseException(Response<T> r, java.lang.Exception e)
Invoked when a command resulted in an exception.void
responseValue(Response<T> r, T value)
Invoked when a response arrives.int
resultsPending()
Response<T>
take()
-
-
-
Method Detail
-
responseValue
public void responseValue(Response<T> r, T value)
Description copied from interface:ResponseHandler
Invoked when a response arrives.- Specified by:
responseValue
in 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:ResponseHandler
Invoked when a command resulted in an exception.- Specified by:
responseException
in 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
-
-