|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.remoting.AbstractInvoker
org.jboss.remoting.RemoteClientInvoker
org.jboss.remoting.transport.socket.SocketClientInvoker
SocketClientInvoker uses Sockets to remotely connect to the a remote ServerInvoker, which must be a SocketServerInvoker.
Nested Class Summary | |
protected static class |
SocketClientInvoker.ClientSocket
|
Field Summary | |
protected ServerAddress |
address
connection information |
protected static HashMap |
connectionPools
|
static long |
deserializeTime
|
protected boolean |
enableTcpNoDelay
If the TcpNoDelay option should be used on the socket. |
static long |
getSocketTime
|
static String |
MAX_POOL_SIZE_FLAG
|
static int |
MAX_RETRIES
Set number of retries in getSocket method |
protected int |
maxPoolSize
|
protected int |
numberOfRetries
|
protected LinkedList |
pool
Pool for this invoker. |
static long |
readTime
|
static long |
serializeTime
|
static int |
SO_TIMEOUT_DEFAULT
|
static String |
SO_TIMEOUT_FLAG
|
static boolean |
TCP_NODELAY_DEFAULT
|
static String |
TCP_NODELAY_FLAG
|
protected int |
timeout
|
static long |
usedPooled
|
static long |
writeTime
|
Fields inherited from class org.jboss.remoting.RemoteClientInvoker |
connected |
Fields inherited from class org.jboss.remoting.AbstractInvoker |
classbyteloader, localServerLocator, locator, log |
Constructor Summary | |
SocketClientInvoker(InvokerLocator locator)
|
Method Summary | |
static void |
clearPool(ServerAddress sa)
Close all sockets in a specific pool. |
static void |
clearPools()
Close all sockets in all pools |
protected void |
finalize()
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. |
protected SocketClientInvoker.ClientSocket |
getConnection()
|
protected String |
getDefaultDataType()
Each implementation of the remote client invoker should have a default data type that is uses in the case it is not specified in the invoker locator uri. |
int |
getNumberOfRetries()
|
protected SocketClientInvoker.ClientSocket |
getPooledConnection()
|
String |
getServerHostName()
The name of of the server. |
protected void |
handleConnect()
subclasses must implement this method to provide a hook to connect to the remote server, if this applies to the specific transport. |
protected void |
handleDisconnect()
subclasses must implement this method to provide a hook to disconnect from the remote server, if this applies to the specific transport. |
protected void |
initPool()
|
void |
setNumberOfRetries(int numberOfRetries)
Sets the number of retries to get a socket connection. |
protected void |
setup()
|
protected Object |
transport(String sessionId,
Object invocation,
Map metadata,
Marshaller marshaller,
UnMarshaller unmarshaller)
|
Methods inherited from class org.jboss.remoting.RemoteClientInvoker |
connect, disconnect, getMarshaller, getUnMarshaller, invoke, isConnected, postProcess, preProcess, setMarshaller, setUnMarshaller |
Methods inherited from class org.jboss.remoting.AbstractInvoker |
getClassLoader, getClientLocator, getLocator, setClassLoader, setClientLocator |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.remoting.transport.ClientInvoker |
getClientLocator, setClientLocator |
Methods inherited from interface org.jboss.remoting.Invoker |
getLocator |
Field Detail |
public static final String TCP_NODELAY_FLAG
public static final String MAX_POOL_SIZE_FLAG
public static final String SO_TIMEOUT_FLAG
public static final int SO_TIMEOUT_DEFAULT
public static final boolean TCP_NODELAY_DEFAULT
public static long getSocketTime
public static long readTime
public static long writeTime
public static long serializeTime
public static long deserializeTime
protected boolean enableTcpNoDelay
protected int timeout
public static final int MAX_RETRIES
public static long usedPooled
protected int numberOfRetries
protected LinkedList pool
protected ServerAddress address
protected static HashMap connectionPools
protected int maxPoolSize
Constructor Detail |
public SocketClientInvoker(InvokerLocator locator) throws IOException
Method Detail |
protected void setup() throws Exception
Exception
protected void finalize() throws Throwable
RemoteClientInvoker
finalize
method to dispose of
system resources or to perform other cleanup.
The general contract of finalize is that it is invoked
if and when the JavaTM virtual
machine has determined that there is no longer any
means by which this object can be accessed by any thread that has
not yet died, except as a result of an action taken by the
finalization of some other object or class which is ready to be
finalized. The finalize method may take any action, including
making this object available again to other threads; the usual purpose
of finalize, however, is to perform cleanup actions before
the object is irrevocably discarded. For example, the finalize method
for an object that represents an input/output connection might perform
explicit I/O transactions to break the connection before the object is
permanently discarded.
The finalize method of class Object performs no
special action; it simply returns normally. Subclasses of
Object may override this definition.
The Java programming language does not guarantee which thread will
transport the finalize method for any given object. It is
guaranteed, however, that the thread that invokes finalize will not
be holding any user-visible synchronization locks when finalize is
invoked. If an uncaught exception is thrown by the finalize method,
the exception is ignored and finalization of that object terminates.
After the finalize method has been invoked for an object, no
further action is taken until the Java virtual machine has again
determined that there is no longer any means by which this object can
be accessed by any thread that has not yet died, including possible
actions by other objects or classes which are ready to be finalized,
at which point the object may be discarded.
The finalize method is never invoked more than once by a Java
virtual machine for any given object.
Any exception thrown by the finalize
method causes
the finalization of this object to be halted, but is otherwise
ignored.
finalize
in class RemoteClientInvoker
Throwable
- the Exception
raised by this methodprotected void handleConnect() throws ConnectionFailedException
RemoteClientInvoker
handleConnect
in class RemoteClientInvoker
ConnectionFailedException
protected void handleDisconnect()
RemoteClientInvoker
handleDisconnect
in class RemoteClientInvoker
protected String getDefaultDataType()
getDefaultDataType
in class RemoteClientInvoker
protected Object transport(String sessionId, Object invocation, Map metadata, Marshaller marshaller, UnMarshaller unmarshaller) throws IOException, ConnectionFailedException, ClassNotFoundException
transport
in class RemoteClientInvoker
sessionId
- invocation
- marshaller
-
IOException
ConnectionFailedException
ClassNotFoundException
public static void clearPool(ServerAddress sa)
public static void clearPools()
protected void initPool()
public void setNumberOfRetries(int numberOfRetries)
numberOfRetries
- Must be a number greater than 0public int getNumberOfRetries()
protected SocketClientInvoker.ClientSocket getConnection() throws Exception
Exception
protected SocketClientInvoker.ClientSocket getPooledConnection()
public String getServerHostName() throws Exception
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |