站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 server API Documentation 英文版文档

PooledInvokerProxy (JBoss Server API) - JBoss 4.0.1 sp1 server API Documentation 英文版文档


org.jboss.invocation.pooled.interfaces
Class PooledInvokerProxy

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

public class PooledInvokerProxy
extends Object
implements Invoker, Externalizable

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

Version:
$Revision: 1.8.6.1 $
Author:
Bill Burke
See Also:
Serialized Form

Nested Class Summary
protected static class PooledInvokerProxy.ClientSocket
           
 
Field Summary
protected  ServerAddress address
          connection information
protected static HashMap connectionPools
           
static long deserializeTime
           
static long getSocketTime
           
static int MAX_RETRIES
          Set number of retries in getSocket method
protected  int maxPoolSize
           
protected  LinkedList pool
          Pool for this invoker.
static long readTime
           
static long serializeTime
           
protected static org.jboss.tm.TransactionPropagationContextFactory tpcFactory
          Factory for transaction propagation contexts.
static long usedPooled
           
static long writeTime
           
 
Fields inherited from interface org.jboss.invocation.Invoker
ID
 
Constructor Summary
PooledInvokerProxy()
          Exposed for externalization.
PooledInvokerProxy(ServerAddress sa, int maxPoolSize)
          Create a new Proxy.
 
Method Summary
static void clearPool(ServerAddress sa)
          Close all sockets in a specific pool.
static void clearPools()
          Close all sockets in all pools
protected  PooledInvokerProxy.ClientSocket getConnection()
           
protected  PooledInvokerProxy.ClientSocket getPooledConnection()
           
 String getServerHostName()
          The name of of the server.
 Object getTransactionPropagationContext()
          ???
protected  void initPool()
           
 Object invoke(Invocation invocation)
          The invocation on the delegate, calls the right invoker.
 void readExternal(ObjectInput in)
          Un-externalize this instance.
static void setTPCFactory(org.jboss.tm.TransactionPropagationContextFactory tpcf)
           
 void writeExternal(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 org.jboss.tm.TransactionPropagationContextFactory 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 HashMap connectionPools

address

protected ServerAddress address
connection information


pool

protected 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 sa,
                          int maxPoolSize)
Create a new Proxy.

Method Detail

setTPCFactory

public static void setTPCFactory(org.jboss.tm.TransactionPropagationContextFactory tpcf)

clearPool

public static void clearPool(ServerAddress 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 getConnection()
                                                 throws Exception
Throws:
Exception

getPooledConnection

protected PooledInvokerProxy.ClientSocket getPooledConnection()

getServerHostName

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

Specified by:
getServerHostName in interface Invoker
Throws:
Exception

getTransactionPropagationContext

public Object getTransactionPropagationContext()
                                        throws SystemException
???

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

invoke

public Object invoke(Invocation invocation)
              throws 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
Parameters:
invocation - A pointer to the invocation object
Returns:
Return value of method invocation.
Throws:
Exception - Failed to invoke method.

writeExternal

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

Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

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

Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.