|
||||||||||
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
|
static java.lang.String |
CONNECTION_WAIT
Key for setting time to wait to get permission to get a connection |
static int |
CONNECTION_WAIT_DEFAULT
Default time to wait to get permission to get a connection |
protected static java.util.Map |
connectionPools
|
protected int |
connectionWait
|
static long |
deserializeTime
|
protected boolean |
enableTcpNoDelay
If the TcpNoDelay option should be used on the socket. |
static long |
getSocketTime
|
protected Home |
home
|
protected boolean |
keepAlive
Socket configuration parameters. |
protected boolean |
keepAliveSet
|
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
|
static java.lang.String |
ONEWAY_CONNECTION_TIMEOUT
Key for setting timeout used by OnewayConnectionTask |
static int |
ONEWAY_CONNECTION_TIMEOUT_DEFAULT
Default timeout value used by OnewayConnectionTask. |
protected int |
onewayConnectionTimeout
|
protected boolean |
oOBInline
|
protected boolean |
oOBInlineSet
|
protected java.util.LinkedList |
pool
Pool for this invoker. |
protected int |
port
|
static long |
readTime
|
protected int |
receiveBufferSize
|
protected EDU.oswego.cs.dl.util.concurrent.Semaphore |
semaphore
|
protected static java.util.Map |
semaphores
|
protected int |
sendBufferSize
|
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. |
protected boolean |
soLinger
|
protected int |
soLingerDuration
|
protected boolean |
soLingerSet
|
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. |
protected int |
trafficClass
|
static java.lang.String |
USE_ONEWAY_CONNECTION_TIMEOUT
Key to determine if client side oneway invocations should wait to read version. |
protected boolean |
useOnewayConnectionTimeout
|
static long |
writeTime
|
Fields inherited from class org.jboss.remoting.MicroRemoteClientInvoker |
---|
connected, connectHomes, parentFirstClassLoading |
Fields inherited from class org.jboss.remoting.AbstractInvoker |
---|
classbyteloader, configuration, localServerLocators, locator, serializationType, socketFactory, socketFactoryCreatedFromSSLParameters, version |
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 void |
configureSocket(java.net.Socket s)
|
protected SocketWrapper |
createClientSocket(java.net.Socket socket,
int timeout,
java.util.Map metadata)
|
protected ServerAddress |
createServerAddress(java.net.InetAddress addr,
int port)
|
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,
boolean tryPool,
int timeAllowed)
|
int |
getConnectionWait()
|
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. |
Home |
getHomeInUse()
|
int |
getNumberOfAvailableConnections()
|
int |
getNumberOfCallRetries()
|
int |
getNumberOfRetries()
|
int |
getNumberOfUsedConnections()
|
protected SocketWrapper |
getPooledConnection()
|
int |
getReceiveBufferSize()
|
boolean |
getReuseAddress()
Returns if newly created sockets will have SO_REUSEADDR enabled. |
int |
getSendBufferSize()
|
java.lang.String |
getServerHostName()
The name of of the server. |
int |
getSoLingerDuration()
|
int |
getTrafficClass()
|
protected Home |
getUsableAddress(InvokerLocator locator)
|
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 |
handleRetriableException(SocketWrapper socketWrapper,
java.lang.Exception e,
int retryCount)
|
protected void |
initPool()
|
boolean |
isKeepAlive()
|
boolean |
isOOBInline()
|
boolean |
isSoLinger()
|
void |
setConnectionWait(int connectionWait)
|
void |
setKeepAlive(boolean keepAlive)
|
void |
setNumberOfCallRetries(int numberOfCallRetries)
Sets the number of times an invocation will retry based on getting SocketException. |
void |
setNumberOfRetries(int numberOfRetries)
Sets the number of retries to get a socket connection. |
void |
setOOBInline(boolean inline)
|
void |
setReceiveBufferSize(int receiveBufferSize)
|
void |
setReuseAddress(boolean reuse)
Sets if newly created socket should have SO_REUSEADDR enable. |
void |
setSendBufferSize(int sendBufferSize)
|
void |
setSoLinger(boolean soLinger)
|
void |
setSoLingerDuration(int soLingerDuration)
|
void |
setTrafficClass(int trafficClass)
|
protected void |
setup()
|
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.MicroRemoteClientInvoker |
---|
connect, establishLease, getConnectHomes, getLeasePeriod, getMarshaller, getSessionId, getUnMarshaller, init, invoke, isConnected, postProcess, preProcess, setMarshaller, setUnMarshaller, terminateLease |
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 ONEWAY_CONNECTION_TIMEOUT
public static final java.lang.String USE_ONEWAY_CONNECTION_TIMEOUT
public static final java.lang.String CONNECTION_WAIT
public static final boolean TCP_NODELAY_DEFAULT
public static final int MAX_CALL_RETRIES
public static final int MAX_POOL_SIZE
public static final int ONEWAY_CONNECTION_TIMEOUT_DEFAULT
public static final int CONNECTION_WAIT_DEFAULT
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 int onewayConnectionTimeout
protected boolean useOnewayConnectionTimeout
protected int connectionWait
protected java.util.LinkedList pool
protected EDU.oswego.cs.dl.util.concurrent.Semaphore semaphore
protected ServerAddress address
protected Home home
protected boolean keepAlive
protected boolean keepAliveSet
protected boolean oOBInline
protected boolean oOBInlineSet
protected int receiveBufferSize
protected int sendBufferSize
protected boolean soLinger
protected boolean soLingerSet
protected int soLingerDuration
protected int trafficClass
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 boolean isKeepAlive()
public void setKeepAlive(boolean keepAlive)
public boolean isOOBInline()
public void setOOBInline(boolean inline)
public int getReceiveBufferSize()
public void setReceiveBufferSize(int receiveBufferSize)
public int getSendBufferSize()
public void setSendBufferSize(int sendBufferSize)
public boolean isSoLinger()
public int getSoLingerDuration()
public void setSoLinger(boolean soLinger)
public void setSoLingerDuration(int soLingerDuration)
public int getTrafficClass()
public void setTrafficClass(int trafficClass)
public void disconnect()
MicroRemoteClientInvoker
disconnect
in interface ClientInvoker
disconnect
in class MicroRemoteClientInvoker
public void flushConnectionPool()
public int getConnectionWait()
public void setConnectionWait(int connectionWait)
public Home getHomeInUse()
public void setNumberOfCallRetries(int numberOfCallRetries)
public int getNumberOfCallRetries()
public void setNumberOfRetries(int numberOfRetries)
numberOfRetries
- Must be a number greater than 0.public int getNumberOfRetries()
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(java.net.InetAddress addr, int port)
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 Home getUsableAddress(InvokerLocator locator)
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, InvocationFailureException
java.lang.ClassNotFoundException
InvocationFailureException
protected void handleRetriableException(SocketWrapper socketWrapper, java.lang.Exception e, int retryCount)
protected void initPool()
protected SocketWrapper getConnection(Marshaller marshaller, UnMarshaller unmarshaller, boolean tryPool, 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 void configureSocket(java.net.Socket s) throws java.net.SocketException
java.net.SocketException
protected SocketWrapper getPooledConnection()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |