public class InboundRequestHandler extends java.lang.Object implements RequestHandler
Constructor and Description |
---|
InboundRequestHandler(java.util.List<EndpointAdapter> endpoints,
RequestListenerService service) |
Modifier and Type | Method and Description |
---|---|
int |
getActiveTransactions()
Get the active transactions for this request handler.
|
java.util.List<EndpointAdapter> |
getEndpoints() |
javax.resource.spi.work.ExecutionContext |
getExecutionContext(java.lang.String sessionId) |
RequestListenerService |
getListenerService()
Return the listener service.
|
void |
handleClose(ClientHandle handle)
Called when a client close event occurs.
|
byte[] |
handleRequest(ClientHandle handle,
byte[] requestBytes)
Called when a client has sent a request.
|
void |
handleResponse(ClientHandle handle,
byte[] responseBytes)
Send a response to the supplied client (sessionId).
|
void |
handleTimeout(ClientHandle handle)
Called when a select times out waiting for client keys.
|
protected InboundRequest |
readRequest(JBaseObjectReader reader) |
javax.resource.spi.work.ExecutionContext |
removeExecutionContext(java.lang.String sessionId) |
void |
setExecutionContext(java.lang.String sessionId,
javax.resource.spi.work.ExecutionContext ec) |
protected void |
writeResponse(JBaseObjectWriter writer,
JBaseSerializable response) |
public InboundRequestHandler(java.util.List<EndpointAdapter> endpoints, RequestListenerService service)
public java.util.List<EndpointAdapter> getEndpoints()
public RequestListenerService getListenerService()
RequestHandler
Return the listener service. The listener service is effectively a root context.
getListenerService
in interface RequestHandler
public void handleClose(ClientHandle handle)
RequestHandler
Called when a client close event occurs.
handleClose
in interface RequestHandler
public void handleTimeout(ClientHandle handle)
RequestHandler
Called when a select times out waiting for client keys.
handleTimeout
in interface RequestHandler
public byte[] handleRequest(ClientHandle handle, byte[] requestBytes)
RequestHandler
Called when a client has sent a request.
handleRequest
in interface RequestHandler
public void handleResponse(ClientHandle handle, byte[] responseBytes) throws RequestHandlerException
RequestHandler
Send a response to the supplied client (sessionId).
handleResponse
in interface RequestHandler
RequestHandlerException
protected InboundRequest readRequest(JBaseObjectReader reader) throws java.io.IOException
java.io.IOException
protected void writeResponse(JBaseObjectWriter writer, JBaseSerializable response) throws java.io.IOException
java.io.IOException
public javax.resource.spi.work.ExecutionContext getExecutionContext(java.lang.String sessionId)
public javax.resource.spi.work.ExecutionContext removeExecutionContext(java.lang.String sessionId)
public void setExecutionContext(java.lang.String sessionId, javax.resource.spi.work.ExecutionContext ec)
public int getActiveTransactions()
Get the active transactions for this request handler.