org.jboss.invocation.pooled.interfaces
Class PooledInvokerProxy

java.lang.Object
  extended byorg.jboss.invocation.pooled.interfaces.PooledInvokerProxy
All Implemented Interfaces:
java.io.Externalizable, Invoker (src) , java.rmi.Remote, java.io.Serializable

public class PooledInvokerProxy
extends java.lang.Object
implements Invoker (src) , java.io.Externalizable

Client socket connections are pooled to avoid the overhead of making a connection. RMI seems to do a new connection with each request.

See Also:
Serialized Form

Nested Class Summary
protected static class PooledInvokerProxy.ClientSocket (src)
           
 
Field Summary
protected  ServerAddress (src) address
          connection information
protected static java.util.HashMap connectionPools
           
static long deserializeTime
           
static long getSocketTime
           
static int MAX_RETRIES
          Set number of retries in getSocket method
protected  int maxPoolSize
           
protected  java.util.LinkedList pool
          Pool for this invoker.
static long readTime
           
static long serializeTime
           
protected static TransactionPropagationContextFactory (src) tpcFactory
          Factory for transaction propagation contexts.
static long usedPooled
           
static long writeTime
           
 
Fields inherited from interface org.jboss.invocation.Invoker (src)
ID
 
Constructor Summary
PooledInvokerProxy()
          Exposed for externalization.
PooledInvokerProxy(ServerAddress (src)  sa, int maxPoolSize)
          Create a new Proxy.
 
Method Summary
static void clearPool(ServerAddress (src)  sa)
          Close all sockets in a specific pool.
static void clearPools()
          Close all sockets in all pools
protected  PooledInvokerProxy.ClientSocket (src) getConnection()
           
protected  PooledInvokerProxy.ClientSocket (src) getPooledConnection()
           
 java.lang.String getServerHostName()
          The name of of the server.
 java.lang.Object getTransactionPropagationContext()
          ???
protected  void initPool()
           
 java.lang.Object invoke(Invocation (src)  invocation)
          The invocation on the delegate, calls the right invoker.
 void readExternal(java.io.ObjectInput in)
          Un-externalize this instance.
static void setTPCFactory(TransactionPropagationContextFactory (src)  tpcf)
           
 void writeExternal(java.io.ObjectOutput out)
          Externalize this instance and handle obtaining the remoteInvoker stub
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tpcFactory

protected static TransactionPropagationContextFactory (src)  tpcFactory
Factory for transaction propagation contexts.


getSocketTime

public static long getSocketTime

readTime

public static long readTime

writeTime

public static long writeTime

serializeTime

public static long serializeTime

deserializeTime

public static long deserializeTime

usedPooled

public static long usedPooled

MAX_RETRIES

public static int MAX_RETRIES
Set number of retries in getSocket method


connectionPools

protected static java.util.HashMap connectionPools

address

protected ServerAddress (src)  address
connection information


pool

protected java.util.LinkedList pool
Pool for this invoker. This is shared between all instances of proxies attached to a specific invoker


maxPoolSize

protected int maxPoolSize
Constructor Detail

PooledInvokerProxy

public PooledInvokerProxy()
Exposed for externalization.


PooledInvokerProxy

public PooledInvokerProxy(ServerAddress (src)  sa,
                          int maxPoolSize)
Create a new Proxy.

Method Detail

setTPCFactory

public static void setTPCFactory(TransactionPropagationContextFactory (src)  tpcf)

clearPool

public static void clearPool(ServerAddress (src)  sa)
Close all sockets in a specific pool.


clearPools

public static void clearPools()
Close all sockets in all pools


initPool

protected void initPool()

getConnection

protected PooledInvokerProxy.ClientSocket (src)  getConnection()
                                                 throws java.lang.Exception
Throws:
java.lang.Exception

getPooledConnection

protected PooledInvokerProxy.ClientSocket (src)  getPooledConnection()

getServerHostName

public java.lang.String getServerHostName()
                                   throws java.lang.Exception
The name of of the server.

Specified by:
getServerHostName in interface Invoker (src)
Throws:
java.lang.Exception

getTransactionPropagationContext

public java.lang.Object getTransactionPropagationContext()
                                                  throws SystemException (src) 
???

Returns:
the transaction propagation context of the transaction associated with the current thread. Returns null if the transaction manager was never set, or if no transaction is associated with the current thread.
Throws:
SystemException (src)

invoke

public java.lang.Object invoke(Invocation (src)  invocation)
                        throws java.lang.Exception
The invocation on the delegate, calls the right invoker. Remote if we are remote, local if we are local.

Specified by:
invoke in interface Invoker (src)
Parameters:
invocation - A pointer to the invocation object
Returns:
Return value of method invocation.
Throws:
java.lang.Exception - Failed to invoke method.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Externalize this instance and handle obtaining the remoteInvoker stub

Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Un-externalize this instance.

Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException