|
||||||||||
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.MicroRemoteClientInvoker
org.jboss.remoting.RemoteClientInvoker
org.jboss.remoting.transport.socket.MicroSocketClientInvoker
public class MicroSocketClientInvoker
SocketClientInvoker uses Sockets to remotely connect to the a remote ServerInvoker, which must be a SocketServerInvoker.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jboss.remoting.AbstractInvoker |
---|
AbstractInvoker.CallbackLocatorHolder |
Field Summary | |
---|---|
protected java.net.InetAddress |
addr
|
protected ServerAddress |
address
connection information |
static java.lang.String |
CLIENT_SOCKET_CLASS_FLAG
Specifies the fully qualified class name for the custom SocketWrapper implementation to use on the client. |
protected java.lang.Class |
clientSocketClass
|
protected java.lang.String |
clientSocketClassName
|
protected static java.util.Map |
connectionPools
|
static long |
deserializeTime
|
protected boolean |
enableTcpNoDelay
If the TcpNoDelay option should be used on the socket. |
static long |
getSocketTime
|
static int |
MAX_CALL_RETRIES
Default maximum number of times a invocation will be made when it gets a SocketException. |
static int |
MAX_POOL_SIZE
Default maximum number of socket connections allowed at any point in time. |
static java.lang.String |
MAX_POOL_SIZE_FLAG
The client side maximum number of threads. |
protected int |
maxPoolSize
|
protected int |
numberOfCallRetries
|
protected java.util.LinkedList |
pool
Pool for this invoker. |
protected int |
port
|
static long |
readTime
|
protected EDU.oswego.cs.dl.util.concurrent.Semaphore |
semaphore
|
protected static java.util.Map |
semaphores
|
static long |
serializeTime
|
protected boolean |
shouldCheckConnection
Indicates if will check the socket connection when getting from pool by sending byte over the connection to validate is still good. |
static boolean |
TCP_NODELAY_DEFAULT
Default value for enable TCP nodelay. |
static java.lang.String |
TCP_NODELAY_FLAG
Can be either true or false and will indicate if client socket should have TCP_NODELAY turned on or off. |
java.lang.Object |
usedPoolLock
|
static java.lang.String |
WRAP_INTERRUPTED_EXCEPTION
Configuration key for determining if an InterruptedException should be rethrown or wrapped in a RuntimeException. |
protected boolean |
wrapInterruptedException
|
static long |
writeTime
|
Fields inherited from class org.jboss.remoting.MicroRemoteClientInvoker |
---|
connected |
Fields inherited from class org.jboss.remoting.AbstractInvoker |
---|
classbyteloader, configuration, localServerLocators, locator, passConfigMapToMarshalFactory, serializationType, socketFactory, socketFactoryCreatedFromSSLParameters |
Constructor Summary | |
---|---|
MicroSocketClientInvoker(InvokerLocator locator)
|
|
MicroSocketClientInvoker(InvokerLocator locator,
java.util.Map configuration)
|
Method Summary | |
---|---|
boolean |
checkingConnection()
Indicates if will check socket connection when returning from pool by sending byte to the server. |
static void |
clearPool(java.util.LinkedList thepool)
Close all sockets in a specific pool. |
static void |
clearPools()
Close all sockets in all pools. |
protected void |
configureParameters()
|
protected SocketWrapper |
createClientSocket(java.net.Socket socket,
int timeout,
java.util.Map metadata)
|
protected ServerAddress |
createServerAddress()
|
protected java.net.Socket |
createSocket(java.lang.String address,
int port,
int timeout)
|
void |
disconnect()
disconnect from the remote invokere |
protected void |
finalize()
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. |
void |
flushConnectionPool()
|
protected SocketWrapper |
getConnection(Marshaller marshaller,
UnMarshaller unmarshaller,
int timeAllowed)
|
protected java.lang.String |
getDefaultDataType()
Each implementation of the remote client invoker should have a default data type that is used in the case it is not specified in the invoker locator URI. |
int |
getNumberOfAvailableConnections()
|
int |
getNumberOfCallRetries()
|
int |
getNumberOfUsedConnections()
|
protected SocketWrapper |
getPooledConnection()
|
boolean |
getReuseAddress()
Returns if newly created sockets will have SO_REUSEADDR enabled. |
java.lang.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 java.lang.Object |
handleException(java.lang.Exception ex,
SocketWrapper socketWrapper)
|
protected void |
initPool()
|
boolean |
isWrapInterruptedException()
|
void |
setNumberOfCallRetries(int numberOfCallRetries)
Sets the number of times an invocation will retry based on getting SocketException. |
void |
setReuseAddress(boolean reuse)
Sets if newly created socket should have SO_REUSEADDR enable. |
protected void |
setup()
|
void |
setWrapInterruptedException(boolean wrapInterruptedException)
|
protected java.lang.Object |
transport(java.lang.String sessionID,
java.lang.Object invocation,
java.util.Map metadata,
Marshaller marshaller,
UnMarshaller unmarshaller)
|
Methods inherited from class org.jboss.remoting.RemoteClientInvoker |
---|
useAllParams |
Methods inherited from class org.jboss.remoting.MicroRemoteClientInvoker |
---|
connect, establishLease, getLeasePeriod, getLeasePinger, getMarshaller, getSessionId, getUnMarshaller, init, invoke, isConnected, postProcess, preProcess, setMarshaller, setUnMarshaller, terminateLease, terminateLease |
Methods inherited from class org.jboss.remoting.AbstractInvoker |
---|
addClientLocator, createSocketFactory, getClassLoader, getClientLocator, getClientLocators, getConfiguration, getLocator, getSerializationType, getSocketFactory, isCompleteSocketFactory, isSocketFactoryCreatedFromSSLParameters, needsCustomSSLConfiguration, setClassLoader, setSerializationType, setSocketFactory, wrapSocketFactory |
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 |
---|
addClientLocator, getClientLocator, getClientLocators, getSocketFactory, setSocketFactory |
Methods inherited from interface org.jboss.remoting.Invoker |
---|
getLocator |
Field Detail |
---|
public static final java.lang.String TCP_NODELAY_FLAG
public static final java.lang.String MAX_POOL_SIZE_FLAG
public static final java.lang.String CLIENT_SOCKET_CLASS_FLAG
public static final java.lang.String WRAP_INTERRUPTED_EXCEPTION
public static final boolean TCP_NODELAY_DEFAULT
public static final int MAX_CALL_RETRIES
public static final int MAX_POOL_SIZE
protected static final java.util.Map connectionPools
protected static final java.util.Map semaphores
public static long getSocketTime
public static long readTime
public static long writeTime
public static long serializeTime
public static long deserializeTime
protected java.net.InetAddress addr
protected int port
protected boolean shouldCheckConnection
protected boolean enableTcpNoDelay
protected java.lang.String clientSocketClassName
protected java.lang.Class clientSocketClass
protected int numberOfCallRetries
protected int maxPoolSize
protected java.util.LinkedList pool
protected EDU.oswego.cs.dl.util.concurrent.Semaphore semaphore
protected ServerAddress address
public java.lang.Object usedPoolLock
protected boolean wrapInterruptedException
Constructor Detail |
---|
public MicroSocketClientInvoker(InvokerLocator locator)
public MicroSocketClientInvoker(InvokerLocator locator, java.util.Map configuration)
Method Detail |
---|
public static void clearPool(java.util.LinkedList thepool)
public static void clearPools()
public boolean checkingConnection()
public boolean getReuseAddress()
public void setReuseAddress(boolean reuse)
public void disconnect()
MicroRemoteClientInvoker
disconnect
in interface ClientInvoker
disconnect
in class MicroRemoteClientInvoker
public void flushConnectionPool()
public void setNumberOfCallRetries(int numberOfCallRetries)
public int getNumberOfCallRetries()
public boolean isWrapInterruptedException()
public void setWrapInterruptedException(boolean wrapInterruptedException)
public java.lang.String getServerHostName() throws java.lang.Exception
java.lang.Exception
public int getNumberOfUsedConnections()
public int getNumberOfAvailableConnections()
protected void setup() throws java.lang.Exception
java.lang.Exception
protected void configureParameters()
protected ServerAddress createServerAddress()
protected void finalize() throws java.lang.Throwable
MicroRemoteClientInvoker
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 MicroRemoteClientInvoker
java.lang.Throwable
- the Exception
raised by this methodprotected void handleConnect() throws ConnectionFailedException
MicroRemoteClientInvoker
handleConnect
in class MicroRemoteClientInvoker
ConnectionFailedException
protected void handleDisconnect()
MicroRemoteClientInvoker
handleDisconnect
in class MicroRemoteClientInvoker
protected java.lang.String getDefaultDataType()
getDefaultDataType
in class MicroRemoteClientInvoker
protected java.lang.Object transport(java.lang.String sessionID, java.lang.Object invocation, java.util.Map metadata, Marshaller marshaller, UnMarshaller unmarshaller) throws java.io.IOException, ConnectionFailedException, java.lang.ClassNotFoundException
transport
in class MicroRemoteClientInvoker
java.io.IOException
ConnectionFailedException
java.lang.ClassNotFoundException
protected java.lang.Object handleException(java.lang.Exception ex, SocketWrapper socketWrapper) throws java.lang.ClassNotFoundException, java.rmi.MarshalException
java.lang.ClassNotFoundException
java.rmi.MarshalException
protected void initPool()
protected SocketWrapper getConnection(Marshaller marshaller, UnMarshaller unmarshaller, int timeAllowed) throws java.lang.Exception
java.lang.Exception
protected SocketWrapper createClientSocket(java.net.Socket socket, int timeout, java.util.Map metadata) throws java.lang.Exception
java.lang.Exception
protected java.net.Socket createSocket(java.lang.String address, int port, int timeout) throws java.io.IOException
java.io.IOException
protected SocketWrapper getPooledConnection()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |