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(java.lang.String name,
java.lang.String protocol,
RpcProcessor rpcServer,
NetworkServer server,
java.net.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,
java.net.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, getRpcProcessorgetSocket, getSocketTimeout, run, setSocketTimeoutclearShutdown, getBindAddress, getHandlerName, getListenBacklog, getNextSessionId, getPort, getProtocolName, getServer, hasBindAddress, hasDebug, hasShutdown, setDebug, setPort, setShutdown, toStringpublic static final int DefaultPacketPoolSize
public static final int DefaultSmallPacketSize
public MultiThreadedTcpRpcSessionHandler(java.lang.String name,
java.lang.String protocol,
RpcProcessor rpcServer,
NetworkServer server,
java.net.InetAddress addr,
int port,
int maxSize)
name - Stringprotocol - StringrpcServer - RpcProcessorserver - NetworkServeraddr - InetAddressport - intmaxSize - intpublic void initializeSessionHandler(NetworkServer server) throws java.io.IOException
initializeSessionHandler in interface SessionHandlerInterfaceinitializeSessionHandler in class SocketSessionHandlerserver - java.io.IOExceptionprotected final RpcPacket allocateRpcPacket(int size)
size - intprotected final void queueRpcRequest(RpcPacket rpc)
rpc - RpcPacketprotected TcpRpcPacketHandler createPacketHandler(int sessId, java.net.Socket sock) throws java.io.IOException
createPacketHandler in class TcpRpcSessionHandlersessId - intsock - Socketjava.io.IOExceptionpublic 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 - 2010 Alfresco Software, Inc. All Rights Reserved.