public class TcpRpcPacketHandler extends SocketPacketHandler implements Runnable
Processes RPC requests received via TCP session.
| Constructor and Description |
|---|
TcpRpcPacketHandler(Socket socket,
int maxRpcSize)
Class constructor to create a TCP RPC handler for a client.
|
TcpRpcPacketHandler(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 for receiving an incoming request.
|
void |
closePacketHandler()
Close the session
|
protected void |
deallocateRpcPacket(RpcPacket pkt)
Deallocate an RPC packet, default method does nothing but a pooled implementation may
return the packet to the pool.
|
protected TcpRpcSessionHandler |
getHandler()
Return the associated session handler
|
int |
getMaximumRpcSize()
Return the maximum RPC size accepted
|
String |
getProtocolName()
Return the protocol name
|
int |
getSessionId()
Return the session id
|
protected void |
processRpc(RpcPacket rpc)
Process an RPC request.
|
protected int |
receiveRpc(byte[] buffer,
int offset,
int maxLen)
Read an RPC request/response
|
protected int |
receiveRpc(RpcPacket rpc)
Read an RPC request/response
|
void |
run()
Thread to read and process the RPC requests for this session
|
protected void |
sendRpc(RpcPacket rpc)
Send an RPC request/response packet
|
availableBytes, getSocket, readPacket, writePacketpublic TcpRpcPacketHandler(TcpRpcSessionHandler handler, int sessId, RpcProcessor server, Socket socket, int maxRpcSize) throws IOException
handler - TcpRpcSessionHandlersessId - intserver - RpcProcessorsocket - SocketmaxRpcSize - intIOExceptionpublic TcpRpcPacketHandler(Socket socket, int maxRpcSize) throws IOException
socket - SocketmaxRpcSize - intIOExceptionpublic String getProtocolName()
getProtocolName in interface PacketHandlerInterfacegetProtocolName in class SocketPacketHandlerpublic final int getSessionId()
public final int getMaximumRpcSize()
protected final TcpRpcSessionHandler getHandler()
public void run()
public void closePacketHandler()
closePacketHandler in interface PacketHandlerInterfaceclosePacketHandler in class SocketPacketHandlerprotected final void sendRpc(RpcPacket rpc) throws IOException
rpc - RpcPacketIOExceptionprotected final int receiveRpc(RpcPacket rpc) throws IOException
rpc - RpcPacketIOExceptionprotected final int receiveRpc(byte[] buffer,
int offset,
int maxLen)
throws IOException
buffer - byte[]offset - intmaxLen - intIOExceptionprotected RpcPacket allocateRpcPacket(int maxSize)
maxSize - intprotected void deallocateRpcPacket(RpcPacket pkt)
pkt - RpcPacketprotected void processRpc(RpcPacket rpc) throws IOException
rpc - RpcPacketIOExceptionCopyright © 2005–2016 Alfresco Software. All rights reserved.