org.jboss.invocation.pooled.server
Class PooledInvokerHA

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.invocation.pooled.server.PooledInvoker (src) 
              extended byorg.jboss.invocation.pooled.server.PooledInvokerHA
All Implemented Interfaces:
InvokerHA (src) , MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , java.lang.Runnable, Service (src) , ServiceMBean (src)

public final class PooledInvokerHA
extends PooledInvoker (src)
implements InvokerHA (src)

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  java.util.HashMap beanMap
           
 
Fields inherited from class org.jboss.invocation.pooled.server.PooledInvoker (src)
acceptThreads, backlog, clientConnectAddress, clientConnectPort, clientMaxPoolSize, clientpool, enableTcpNoDelay, log, maxPoolSize, numAcceptThreads, optimizedInvokerProxy, running, serverBindAddress, serverBindPort, serverSocket, threadpool, timeout, tpcFactory, tpcImporter, trace, transactionManagerService
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
PooledInvokerHA()
           
 
Method Summary
 Invoker (src) createProxy(ObjectName (src)  beanName, LoadBalancePolicy (src)  policy, java.lang.String proxyFamilyName)
           
 java.io.Serializable getStub()
           
 java.lang.Object invoke(Invocation (src)  invocation)
          Invoke a Remote interface method.
protected  void jmxBind()
           
 void registerBean(ObjectName (src)  beanName, HATarget (src)  target)
           
 void unregisterBean(ObjectName (src)  beanName)
           
 
Methods inherited from class org.jboss.invocation.pooled.server.PooledInvoker (src)
destroyService, getBacklog, getClientConnectAddress, getClientConnectPort, getClientMaxPoolSize, getCurrentClientPoolSize, getCurrentThreadPoolSize, getMaxPoolSize, getNumAcceptThreads, getOptimizedInvokerProxy, getServerBindAddress, getServerBindPort, getSocketTimeout, getTransactionManagerService, importTPC, isEnableTcpNoDelay, run, setBacklog, setClientConnectAddress, setClientConnectPort, setClientMaxPoolSize, setEnableTcpNoDelay, setMaxPoolSize, setNumAcceptThreads, setServerBindAddress, setServerBindPort, setSocketTimeout, setTransactionManagerService, startService, stopService
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
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 (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

beanMap

protected java.util.HashMap beanMap
Constructor Detail

PooledInvokerHA

public PooledInvokerHA()
Method Detail

jmxBind

protected void jmxBind()
Overrides:
jmxBind in class PooledInvoker (src)

getStub

public java.io.Serializable getStub()
Specified by:
getStub in interface InvokerHA (src)

registerBean

public void registerBean(ObjectName (src)  beanName,
                         HATarget (src)  target)
                  throws java.lang.Exception
Specified by:
registerBean in interface InvokerHA (src)
Throws:
java.lang.Exception

createProxy

public Invoker (src)  createProxy(ObjectName (src)  beanName,
                           LoadBalancePolicy (src)  policy,
                           java.lang.String proxyFamilyName)
                    throws java.lang.Exception
Specified by:
createProxy in interface InvokerHA (src)
Throws:
java.lang.Exception

unregisterBean

public void unregisterBean(ObjectName (src)  beanName)
                    throws java.lang.Exception
Specified by:
unregisterBean in interface InvokerHA (src)
Throws:
java.lang.Exception

invoke

public java.lang.Object invoke(Invocation (src)  invocation)
                        throws java.lang.Exception
Invoke a Remote interface method.

Overrides:
invoke in class PooledInvoker (src)
Throws:
java.lang.Exception