public class MultiThreadedTcpRpcSessionHandler extends TcpRpcSessionHandler
Extend the basic TCP RPC handler class to process RPC requests using a thread pool.
Modifier and Type | Field and Description |
---|---|
static int |
DefaultPacketPoolSize |
static int |
DefaultSmallPacketSize |
ListenBacklog
Constructor and Description |
---|
MultiThreadedTcpRpcSessionHandler(String name,
String protocol,
RpcProcessor rpcServer,
NetworkServer server,
InetAddress addr,
int port,
int maxSize)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
protected RpcPacket |
allocateRpcPacket(int size)
Allocate an RPC packet from the packet pool
|
protected TcpRpcPacketHandler |
createPacketHandler(int sessId,
Socket sock)
Create a multi-threaded packet handler for the new session
|
void |
initializeSessionHandler(NetworkServer server)
Initialize the session socket handler
|
protected void |
queueRpcRequest(RpcPacket rpc)
Queue an RPC request to the thread pool for processing
|
void |
setPacketPool(int poolSize)
Set the packet pool size
|
void |
setPacketPool(int smallSize,
int smallPool,
int largeSize,
int largePool)
Set the packet pool size
|
void |
setPacketPool(RpcPacketPool pktPool)
Set the packet pool
|
void |
setThreadPool(int numThreads)
Set the thread pool size
|
void |
setThreadPool(RpcRequestThreadPool threadPool)
Set the thread pool
|
acceptConnection, closeSession, closeSessionHandler, getMaximumRpcSize, getRpcProcessor
getSocket, getSocketTimeout, run, setSocketTimeout
clearShutdown, getBindAddress, getHandlerName, getListenBacklog, getNextSessionId, getPort, getProtocolName, getServer, hasBindAddress, hasDebug, hasShutdown, setDebug, setPort, setShutdown, toString
public static final int DefaultPacketPoolSize
public static final int DefaultSmallPacketSize
public MultiThreadedTcpRpcSessionHandler(String name, String protocol, RpcProcessor rpcServer, NetworkServer server, InetAddress addr, int port, int maxSize)
name
- Stringprotocol
- StringrpcServer
- RpcProcessorserver
- NetworkServeraddr
- InetAddressport
- intmaxSize
- intpublic void initializeSessionHandler(NetworkServer server) throws IOException
initializeSessionHandler
in interface SessionHandlerInterface
initializeSessionHandler
in class SocketSessionHandler
server
- NetworkServerIOException
protected final RpcPacket allocateRpcPacket(int size)
size
- intprotected final void queueRpcRequest(RpcPacket rpc)
rpc
- RpcPacketprotected TcpRpcPacketHandler createPacketHandler(int sessId, Socket sock) throws IOException
createPacketHandler
in class TcpRpcSessionHandler
sessId
- intsock
- SocketIOException
public final void setPacketPool(int smallSize, int smallPool, int largeSize, int largePool)
smallSize
- intsmallPool
- intlargeSize
- intlargePool
- intpublic final void setPacketPool(int poolSize)
poolSize
- intpublic final void setPacketPool(RpcPacketPool pktPool)
pktPool
- RpcPacketPoolpublic final void setThreadPool(int numThreads)
numThreads
- intpublic final void setThreadPool(RpcRequestThreadPool threadPool)
threadPool
- RpcRequestThreadPoolCopyright © 2005–2017 Alfresco Software. All rights reserved.