Save This Page
Home » JBoss-5.1.0 » org.jboss.invocation.pooled » server » [javadoc | source]
org.jboss.invocation.pooled.server
public class: PooledInvoker [javadoc | source]
java.lang.Object
   org.jboss.mx.util.JBossNotificationBroadcasterSupport
      org.jboss.system.ServiceMBeanSupport
         org.jboss.invocation.pooled.server.PooledInvoker

All Implemented Interfaces:
    PooledInvokerMBean, Runnable, KernelControllerContextAware, ServiceMBean, MBeanRegistration, NotificationEmitter

Direct Known Subclasses:
    PooledInvokerHA

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.
Nested Class Summary:
class  PooledInvoker.MBeanServerAction  Perform the MBeanServer.invoke op in a PrivilegedExceptionAction if running with a security manager. 
Field Summary
protected static final  Logger log    logger instance. 
protected  boolean enableTcpNoDelay    If the TcpNoDelay option should be used on the socket. 
protected  String serverBindAddress    The internet address to bind to by default. 
protected  int serverBindPort    The server port to bind to. 
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 clientRetryCount    The number of retry attempts on 
protected  int backlog     
protected  String clientSocketFactoryName    The class name of the optional custom client socket factory 
protected  String serverSocketFactoryName    The class name of the optional custom server socket factory 
protected  SocketFactory clientSocketFactory    An optional custom client socket factory 
protected  ServerSocketFactory serverSocketFactory    An optional custom server socket factory 
protected  ServerSocket serverSocket    The server socket for 
protected  String sslDomain    The name of the security domain to use with server sockets that support SSL 
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    The logging trace level flag 
protected  ObjectName transactionManagerService    ObjectName of the transactionManagerService we use. Probably should not be here -- used to set txInterceptor tx mananger. 
protected  PooledInvokerProxy optimizedInvokerProxy     
protected static  TransactionPropagationContextFactory tpcFactory     
protected static  TransactionPropagationContextImporter tpcImporter     
Fields inherited from org.jboss.system.ServiceMBeanSupport:
SERVICE_CONTROLLER_SIG,  log,  server,  serviceName
Method from org.jboss.invocation.pooled.server.PooledInvoker Summary:
destroyService,   getBacklog,   getClientConnectAddress,   getClientConnectPort,   getClientMaxPoolSize,   getClientRetryCount,   getClientSocketFactory,   getClientSocketFactoryName,   getCurrentClientPoolSize,   getCurrentThreadPoolSize,   getMaxPoolSize,   getNumAcceptThreads,   getOptimizedInvokerProxy,   getServerBindAddress,   getServerBindPort,   getServerSocket,   getServerSocketFactory,   getServerSocketFactoryName,   getSocketTimeout,   getSslDomain,   getTransactionManagerService,   importTPC,   invoke,   isEnableTcpNoDelay,   jmxBind,   loadCustomSocketFactories,   run,   setBacklog,   setClientConnectAddress,   setClientConnectPort,   setClientMaxPoolSize,   setClientRetryCount,   setClientSocketFactory,   setClientSocketFactoryName,   setEnableTcpNoDelay,   setMaxPoolSize,   setNumAcceptThreads,   setServerBindAddress,   setServerBindPort,   setServerSocket,   setServerSocketFactory,   setServerSocketFactoryName,   setSocketTimeout,   setSslDomain,   setTransactionManagerService,   startService,   stopService
Methods from org.jboss.system.ServiceMBeanSupport:
create,   createService,   destroy,   destroyService,   getDeploymentInfo,   getLog,   getName,   getNextNotificationSequenceNumber,   getObjectName,   getServer,   getServiceName,   getState,   getStateString,   jbossInternalCreate,   jbossInternalDescription,   jbossInternalDestroy,   jbossInternalLifecycle,   jbossInternalStart,   jbossInternalStop,   pojoChange,   pojoCreate,   pojoDestroy,   pojoStart,   pojoStop,   postDeregister,   postRegister,   preDeregister,   preRegister,   setKernelControllerContext,   start,   startService,   stop,   stopService,   unsetKernelControllerContext
Methods from org.jboss.mx.util.JBossNotificationBroadcasterSupport:
addNotificationListener,   getNotificationInfo,   handleNotification,   nextNotificationSequenceNumber,   removeNotificationListener,   removeNotificationListener,   sendNotification
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.invocation.pooled.server.PooledInvoker Detail:
 protected  void destroyService() throws Exception 
 public int getBacklog() 
 public String getClientConnectAddress() 
 public int getClientConnectPort() 
 public int getClientMaxPoolSize() 
    Getter for property maxPoolSize;
 public int getClientRetryCount() 
 public SocketFactory getClientSocketFactory() 
 public String getClientSocketFactoryName() 
 public int getCurrentClientPoolSize() 
 public int getCurrentThreadPoolSize() 
 public int getMaxPoolSize() 
    Getter for property maxPoolSize;
 public int getNumAcceptThreads() 
    Getter for property numAcceptThreads
 public PooledInvokerProxy getOptimizedInvokerProxy() 
 public String getServerBindAddress() 
 public int getServerBindPort() 
    Getter for property serverBindPort.
 public ServerSocket getServerSocket() 
 public ServerSocketFactory getServerSocketFactory() 
 public String getServerSocketFactoryName() 
 public int getSocketTimeout() 
    Getter for property timeout
 public String getSslDomain() 
 public ObjectName getTransactionManagerService() 
    mbean get-set pair for field transactionManagerService Get the value of transactionManagerService
 protected Transaction importTPC(Object tpc) 
 public Object invoke(Invocation invocation) throws Exception 
    The ServerProtocol will use this method to service an invocation request.
 public boolean isEnableTcpNoDelay() 
 protected  void jmxBind() 
 protected  void loadCustomSocketFactories() 
    Load and instantiate the clientSocketFactory, serverSocketFactory using the TCL and set the bind address and SSL domain if the serverSocketFactory supports it.
 public  void run() 
 public  void setBacklog(int backlog) 
 public  void setClientConnectAddress(String clientConnectAddress) 
 public  void setClientConnectPort(int clientConnectPort) 
 public  void setClientMaxPoolSize(int clientMaxPoolSize) 
    Setter for property maxPoolSize.
 public  void setClientRetryCount(int clientRetryCount) 
 public  void setClientSocketFactory(SocketFactory clientSocketFactory) 
 public  void setClientSocketFactoryName(String clientSocketFactoryName) 
 public  void setEnableTcpNoDelay(boolean enableTcpNoDelay) 
 public  void setMaxPoolSize(int maxPoolSize) 
    Setter for property maxPoolSize.
 public  void setNumAcceptThreads(int size) 
    Setter for property numAcceptThreads
 public  void setServerBindAddress(String serverBindAddress) 
 public  void setServerBindPort(int serverBindPort) 
    Setter for property serverBindPort.
 public  void setServerSocket(ServerSocket serverSocket) 
 public  void setServerSocketFactory(ServerSocketFactory serverSocketFactory) 
 public  void setServerSocketFactoryName(String serverSocketFactoryName) 
 public  void setSocketTimeout(int time) 
    Setter for property timeout
 public  void setSslDomain(String sslDomain) 
 public  void setTransactionManagerService(ObjectName transactionManagerService) 
    Set the value of transactionManagerService
 public  void startService() throws Exception 
    Starts this IL, and binds it to JNDI
 public  void stopService() throws Exception 
    Stops this service, and unbinds it from JNDI.