|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.util.JBossNotificationBroadcasterSupport org.jboss.system.ServiceMBeanSupport org.jboss.invocation.pooled.server.PooledInvoker
This invoker pools Threads and client connections to one server socket. The purpose is to avoid a bunch of failings of RMI. 1. Avoid making a client socket connection with every invocation call. This is very expensive. Also on windows if too many clients try to connect at the same time, you get connection refused exceptions. This invoker/proxy combo alleviates this. 2. Avoid creating a thread per invocation. The client/server connection is preserved and attached to the same thread. So we have connection pooling on the server and client side, and thread pooling on the server side. Pool, is an LRU pool, so resources should be cleaned up.
Field Summary | |
protected Thread[] |
acceptThreads
|
protected int |
backlog
|
protected String |
clientConnectAddress
The internet address client will use to connect to the sever. |
protected int |
clientConnectPort
The port a client will use to connect to the sever. |
protected int |
clientMaxPoolSize
|
protected LRUPool |
clientpool
|
protected boolean |
enableTcpNoDelay
If the TcpNoDelay option should be used on the socket. |
protected static org.jboss.logging.Logger |
log
logger instance. |
protected int |
maxPoolSize
|
protected int |
numAcceptThreads
|
protected PooledInvokerProxy |
optimizedInvokerProxy
|
protected boolean |
running
|
protected String |
serverBindAddress
The internet address to bind to by default. |
protected int |
serverBindPort
The server port to bind to. |
protected ServerSocket |
serverSocket
|
protected LinkedList |
threadpool
|
protected int |
timeout
|
protected static org.jboss.tm.TransactionPropagationContextFactory |
tpcFactory
|
protected static org.jboss.tm.TransactionPropagationContextImporter |
tpcImporter
|
protected boolean |
trace
The logging trace level flag |
protected javax.management.ObjectName |
transactionManagerService
ObjectName of the transactionManagerService we use. |
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.ServiceMBean |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
PooledInvoker()
|
Method Summary | |
protected void |
destroyService()
|
int |
getBacklog()
|
String |
getClientConnectAddress()
|
int |
getClientConnectPort()
|
int |
getClientMaxPoolSize()
Getter for property maxPoolSize; |
int |
getCurrentClientPoolSize()
|
int |
getCurrentThreadPoolSize()
|
int |
getMaxPoolSize()
Getter for property maxPoolSize; |
int |
getNumAcceptThreads()
Getter for property numAcceptThreads |
PooledInvokerProxy |
getOptimizedInvokerProxy()
|
String |
getServerBindAddress()
|
int |
getServerBindPort()
Getter for property serverBindPort. |
int |
getSocketTimeout()
Getter for property timeout |
javax.management.ObjectName |
getTransactionManagerService()
mbean get-set pair for field transactionManagerService Get the value of transactionManagerService |
protected Transaction |
importTPC(Object tpc)
|
Object |
invoke(Invocation invocation)
The ServerProtocol will use this method to service an invocation request. |
boolean |
isEnableTcpNoDelay()
|
protected void |
jmxBind()
|
void |
run()
|
void |
setBacklog(int backlog)
|
void |
setClientConnectAddress(String clientConnectAddress)
|
void |
setClientConnectPort(int clientConnectPort)
|
void |
setClientMaxPoolSize(int clientMaxPoolSize)
Setter for property maxPoolSize. |
void |
setEnableTcpNoDelay(boolean enableTcpNoDelay)
|
void |
setMaxPoolSize(int maxPoolSize)
Setter for property maxPoolSize. |
void |
setNumAcceptThreads(int size)
Setter for property numAcceptThreads |
void |
setServerBindAddress(String serverBindAddress)
|
void |
setServerBindPort(int serverBindPort)
Setter for property serverBindPort. |
void |
setSocketTimeout(int time)
Setter for property timeout |
void |
setTransactionManagerService(javax.management.ObjectName transactionManagerService)
Set the value of transactionManagerService |
void |
startService()
Starts this IL, and binds it to JNDI |
void |
stopService()
Stops this service, and unbinds it from JNDI. |
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
create, createService, destroy, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.system.ServiceMBean |
getName, getState, getStateString, jbossInternalLifecycle |
Methods inherited from interface org.jboss.system.Service |
create, destroy, start, stop |
Field Detail |
protected static final org.jboss.logging.Logger log
protected boolean enableTcpNoDelay
protected String serverBindAddress
protected int serverBindPort
protected String clientConnectAddress
protected int clientConnectPort
protected int backlog
protected ServerSocket serverSocket
protected int timeout
protected int maxPoolSize
protected int clientMaxPoolSize
protected int numAcceptThreads
protected Thread[] acceptThreads
protected LRUPool clientpool
protected LinkedList threadpool
protected boolean running
protected boolean trace
protected javax.management.ObjectName transactionManagerService
transactionManagerService
we use.
Probably should not be here -- used to set txInterceptor tx mananger.
protected PooledInvokerProxy optimizedInvokerProxy
protected static org.jboss.tm.TransactionPropagationContextFactory tpcFactory
protected static org.jboss.tm.TransactionPropagationContextImporter tpcImporter
Constructor Detail |
public PooledInvoker()
Method Detail |
protected void jmxBind()
public void startService() throws Exception
Exception
- Description of Exceptionpublic void run()
public void stopService() throws Exception
Exception
protected void destroyService() throws Exception
Exception
public Object invoke(Invocation invocation) throws Exception
Exception
protected Transaction importTPC(Object tpc)
public int getNumAcceptThreads()
getNumAcceptThreads
in interface PooledInvokerMBean
public void setNumAcceptThreads(int size)
setNumAcceptThreads
in interface PooledInvokerMBean
size
- New value of property numAcceptThreads.public int getMaxPoolSize()
getMaxPoolSize
in interface PooledInvokerMBean
public void setMaxPoolSize(int maxPoolSize)
setMaxPoolSize
in interface PooledInvokerMBean
maxPoolSize
- New value of property serverBindPort.public int getClientMaxPoolSize()
getClientMaxPoolSize
in interface PooledInvokerMBean
public void setClientMaxPoolSize(int clientMaxPoolSize)
setClientMaxPoolSize
in interface PooledInvokerMBean
clientMaxPoolSize
- New value of property serverBindPort.public int getSocketTimeout()
getSocketTimeout
in interface PooledInvokerMBean
public void setSocketTimeout(int time)
setSocketTimeout
in interface PooledInvokerMBean
time
- New value of property timeoutpublic int getCurrentClientPoolSize()
getCurrentClientPoolSize
in interface PooledInvokerMBean
public int getCurrentThreadPoolSize()
getCurrentThreadPoolSize
in interface PooledInvokerMBean
public int getServerBindPort()
getServerBindPort
in interface PooledInvokerMBean
public void setServerBindPort(int serverBindPort)
setServerBindPort
in interface PooledInvokerMBean
serverBindPort
- New value of property serverBindPort.public String getClientConnectAddress()
getClientConnectAddress
in interface PooledInvokerMBean
public void setClientConnectAddress(String clientConnectAddress)
setClientConnectAddress
in interface PooledInvokerMBean
public int getClientConnectPort()
getClientConnectPort
in interface PooledInvokerMBean
public void setClientConnectPort(int clientConnectPort)
setClientConnectPort
in interface PooledInvokerMBean
public int getBacklog()
getBacklog
in interface PooledInvokerMBean
public void setBacklog(int backlog)
setBacklog
in interface PooledInvokerMBean
public boolean isEnableTcpNoDelay()
isEnableTcpNoDelay
in interface PooledInvokerMBean
public void setEnableTcpNoDelay(boolean enableTcpNoDelay)
setEnableTcpNoDelay
in interface PooledInvokerMBean
public String getServerBindAddress()
getServerBindAddress
in interface PooledInvokerMBean
public void setServerBindAddress(String serverBindAddress)
setServerBindAddress
in interface PooledInvokerMBean
public javax.management.ObjectName getTransactionManagerService()
getTransactionManagerService
in interface PooledInvokerMBean
public void setTransactionManagerService(javax.management.ObjectName transactionManagerService)
setTransactionManagerService
in interface PooledInvokerMBean
transactionManagerService
- Value to assign to transactionManagerServicepublic PooledInvokerProxy getOptimizedInvokerProxy()
getOptimizedInvokerProxy
in interface PooledInvokerMBean
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |