org.jboss.remoting.transport.socket
Class SocketClientInvoker

java.lang.Object
  extended by org.jboss.remoting.AbstractInvoker
      extended by org.jboss.remoting.MicroRemoteClientInvoker
          extended by org.jboss.remoting.RemoteClientInvoker
              extended by org.jboss.remoting.transport.socket.MicroSocketClientInvoker
                  extended by org.jboss.remoting.transport.socket.SocketClientInvoker
All Implemented Interfaces:
Invoker, ClientInvoker
Direct Known Subclasses:
BisocketClientInvoker, MultiplexClientInvoker, SSLSocketClientInvoker

public class SocketClientInvoker
extends MicroSocketClientInvoker

SocketClientInvoker uses Sockets to remotely connect to the a remote ServerInvoker, which must be a SocketServerInvoker.

Version:
$Revision: 4287 $
Author:
Jeff Haynie, Tom Elrod

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.remoting.AbstractInvoker
AbstractInvoker.CallbackLocatorHolder
 
Field Summary
static int SO_TIMEOUT_DEFAULT
          Default value for socket timeout is 30 minutes.
static java.lang.String SO_TIMEOUT_FLAG
           
protected  int timeout
           
 
Fields inherited from class org.jboss.remoting.transport.socket.MicroSocketClientInvoker
addr, address, CLIENT_SOCKET_CLASS_FLAG, clientSocketClass, clientSocketClassName, connectionPools, deserializeTime, enableTcpNoDelay, getSocketTime, MAX_CALL_RETRIES, MAX_POOL_SIZE, MAX_POOL_SIZE_FLAG, maxPoolSize, numberOfCallRetries, pool, port, readTime, semaphore, semaphores, serializeTime, shouldCheckConnection, TCP_NODELAY_DEFAULT, TCP_NODELAY_FLAG, usedPoolLock, WRAP_INTERRUPTED_EXCEPTION, wrapInterruptedException, 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
SocketClientInvoker(InvokerLocator locator)
          Set number of retries in getSocket method
SocketClientInvoker(InvokerLocator locator, java.util.Map configuration)
           
 
Method Summary
protected  void configureParameters()
           
protected  SocketWrapper createClientSocket(java.net.Socket socket, int timeout, java.util.Map metadata)
          used for debugging (tracing) connections leaks
protected  ServerAddress createServerAddress()
           
protected  java.net.Socket createSocket(java.lang.String address, int port, int timeout)
           
protected  SocketWrapper getPooledConnection()
           
 int getTimeout()
          Getter for property timeout
protected  java.lang.Object handleException(java.lang.Exception ex, SocketWrapper socketWrapper)
           
 java.lang.String toString()
           
 
Methods inherited from class org.jboss.remoting.transport.socket.MicroSocketClientInvoker
checkingConnection, clearPool, clearPools, disconnect, finalize, flushConnectionPool, getConnection, getDefaultDataType, getNumberOfAvailableConnections, getNumberOfCallRetries, getNumberOfUsedConnections, getReuseAddress, getServerHostName, handleConnect, handleDisconnect, initPool, isWrapInterruptedException, setNumberOfCallRetries, setReuseAddress, setup, setWrapInterruptedException, transport
 
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, 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

SO_TIMEOUT_FLAG

public static final java.lang.String SO_TIMEOUT_FLAG
See Also:
Constant Field Values

SO_TIMEOUT_DEFAULT

public static final int SO_TIMEOUT_DEFAULT
Default value for socket timeout is 30 minutes.

See Also:
Constant Field Values

timeout

protected int timeout
Constructor Detail

SocketClientInvoker

public SocketClientInvoker(InvokerLocator locator)
Set number of retries in getSocket method


SocketClientInvoker

public SocketClientInvoker(InvokerLocator locator,
                           java.util.Map configuration)
Method Detail

createServerAddress

protected ServerAddress createServerAddress()
Overrides:
createServerAddress in class MicroSocketClientInvoker

configureParameters

protected void configureParameters()
Overrides:
configureParameters in class MicroSocketClientInvoker

handleException

protected java.lang.Object handleException(java.lang.Exception ex,
                                           SocketWrapper socketWrapper)
                                    throws java.lang.ClassNotFoundException,
                                           java.rmi.MarshalException
Overrides:
handleException in class MicroSocketClientInvoker
Throws:
java.lang.ClassNotFoundException
java.rmi.MarshalException

createClientSocket

protected SocketWrapper createClientSocket(java.net.Socket socket,
                                           int timeout,
                                           java.util.Map metadata)
                                    throws java.lang.Exception
used for debugging (tracing) connections leaks

Overrides:
createClientSocket in class MicroSocketClientInvoker
Throws:
java.lang.Exception

createSocket

protected java.net.Socket createSocket(java.lang.String address,
                                       int port,
                                       int timeout)
                                throws java.io.IOException
Overrides:
createSocket in class MicroSocketClientInvoker
Throws:
java.io.IOException

getPooledConnection

protected SocketWrapper getPooledConnection()
Overrides:
getPooledConnection in class MicroSocketClientInvoker

getTimeout

public int getTimeout()
Getter for property timeout

Returns:
Value of property timeout

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 1998-2005 JBoss Inc . All Rights Reserved.