public class MultiThreadedTcpRpcPacketHandler extends TcpRpcPacketHandler implements RpcPacketHandler
Adds multi-threaded processing of RPC requests to the standard TCP RPC handler.
Constructor and Description |
---|
MultiThreadedTcpRpcPacketHandler(TcpRpcSessionHandler handler,
int sessId,
RpcProcessor server,
Socket socket,
int maxRpcSize)
Class constructor to create a TCP RPC handler for a server.
|
Modifier and Type | Method and Description |
---|---|
protected RpcPacket |
allocateRpcPacket(int maxSize)
Allocate an RPC packet from the packet pool
|
protected void |
deallocateRpcPacket(RpcPacket pkt)
Deallocate an RPC packet, return the packet to the pool.
|
protected MultiThreadedTcpRpcSessionHandler |
getSessionHandler()
Return the multi-threaded RPC session handler
|
protected void |
processRpc(RpcPacket rpc)
Process an RPC request by passing the request to a pool of worker threads.
|
void |
sendRpcResponse(RpcPacket rpc)
Send an RPC response using the TCP socket connection
|
closePacketHandler, getHandler, getMaximumRpcSize, getProtocolName, getSessionId, receiveRpc, receiveRpc, run, sendRpc
availableBytes, getSocket, readPacket, writePacket
public MultiThreadedTcpRpcPacketHandler(TcpRpcSessionHandler handler, int sessId, RpcProcessor server, Socket socket, int maxRpcSize) throws IOException
handler
- TcpRpcSessionHandlersessId
- intserver
- RpcProcessorsocket
- SocketmaxRpcSize
- intIOException
protected final MultiThreadedTcpRpcSessionHandler getSessionHandler()
protected RpcPacket allocateRpcPacket(int maxSize)
allocateRpcPacket
in class TcpRpcPacketHandler
maxSize
- intprotected void deallocateRpcPacket(RpcPacket pkt)
deallocateRpcPacket
in class TcpRpcPacketHandler
pkt
- RpcPacketprotected void processRpc(RpcPacket rpc) throws IOException
processRpc
in class TcpRpcPacketHandler
rpc
- RpcPacketIOException
public void sendRpcResponse(RpcPacket rpc) throws IOException
sendRpcResponse
in interface RpcPacketHandler
rpc
- RpcPacketIOException
Copyright © 2005–2018 Alfresco Software. All rights reserved.