org.jboss.remoting.transport.socket
Class SocketServerInvoker

java.lang.Object
  extended byorg.jboss.remoting.AbstractInvoker (src) 
      extended byorg.jboss.remoting.ServerInvoker (src) 
          extended byorg.jboss.remoting.transport.socket.SocketServerInvoker
All Implemented Interfaces:
Invoker (src) , java.lang.Runnable, ServerInvokerMBean (src) , SocketServerInvokerMBean (src)

public class SocketServerInvoker
extends ServerInvoker (src)
implements java.lang.Runnable, SocketServerInvokerMBean (src)

SocketServerInvoker is the server-side of a SOCKET based transport


Field Summary
protected  java.lang.Thread[] acceptThreads
           
protected  int backlog
           
protected  java.lang.String clientConnectAddress
          The internet address client will use to connect to the sever.
protected  int clientConnectPort
          The port a client will use to connect to the sever.
protected  LRUPool (src) clientpool
           
protected  int maxPoolSize
           
protected  int numAcceptThreads
           
protected  boolean running
           
protected  java.lang.String serverBindAddress
          The internet address to bind to by default.
protected  int serverBindPort
          The server port to bind to.
protected  java.net.ServerSocket serverSocket
           
protected  java.util.LinkedList threadpool
           
protected  int timeout
           
protected  boolean trace
          The logging trace level flag
 
Fields inherited from class org.jboss.remoting.ServerInvoker (src)
callbackHandlers, handlers, MAX_NUM_ONEWAY_THREADS
 
Fields inherited from class org.jboss.remoting.AbstractInvoker (src)
classbyteloader, localServerLocator, locator, log
 
Constructor Summary
SocketServerInvoker(InvokerLocator (src)  locator)
           
SocketServerInvoker(InvokerLocator (src)  locator, java.util.Map configuration)
           
 
Method Summary
protected  void finalize()
           
 java.net.InetAddress getAddress()
           
 int getBacklog()
           
 java.lang.String getClientConnectAddress()
           
 int getCurrentClientPoolSize()
           
 int getCurrentThreadPoolSize()
           
protected  java.lang.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 getMaxPoolSize()
          Setter for max pool size.
 java.lang.String getMBeanObjectName()
          Returns the String for the object name to be used for the invoker.
 int getNumAcceptThreads()
          Getter for property numAcceptThreads
 int getPort()
           
 java.lang.String getServerBindAddress()
           
 int getServerBindPort()
          Getter for property serverBindPort.
 int getSocketTimeout()
          Getter for property timeout
 boolean isTransportBiDirectional()
          returns true if the transport is bi-directional in nature, for example, SOAP in unidirectional and SOCKETs are bi-directional (unless behind a firewall for example).
 void run()
           
 void setBacklog(int backlog)
           
 void setClientConnectAddress(java.lang.String clientConnectAddress)
          This method should only be called by the service controller when this invoker is specified within the Connector configuration of a service xml.
 void setMaxPoolSize(int maxPoolSize)
          The number of server threads for processing client.
 void setNumAcceptThreads(int size)
          Setter for property numAcceptThreads
 void setServerBindAddress(java.lang.String serverBindAddress)
           
 void setServerBindPort(int serverBindPort)
          Setter for property serverBindPort.
 void setSocketTimeout(int time)
          Setter for property timeout
protected  void setup()
           
 void start()
          Starts the invoker.
 void stop()
          Stops the invoker.
 
Methods inherited from class org.jboss.remoting.ServerInvoker (src)
addInvocationHandler, destroy, getConfiguration, getDataType, getInvocationHandler, getInvocationHandlers, getMBeanServer, getSupportedSubsystems, hasInvocationHandler, invoke, invoke, isStarted, postProcess, preProcess, removeInvocationHandler, setConfigration, setMBeanServer
 
Methods inherited from class org.jboss.remoting.AbstractInvoker (src)
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.ServerInvokerMBean (src)
destroy, getConfiguration, getDataType, isStarted, setConfigration
 

Field Detail

serverSocket

protected java.net.ServerSocket serverSocket

running

protected boolean running

backlog

protected int backlog

acceptThreads

protected java.lang.Thread[] acceptThreads

numAcceptThreads

protected int numAcceptThreads

maxPoolSize

protected int maxPoolSize

clientpool

protected LRUPool (src)  clientpool

threadpool

protected java.util.LinkedList threadpool

timeout

protected int timeout

trace

protected boolean trace
The logging trace level flag


clientConnectPort

protected int clientConnectPort
The port a client will use to connect to the sever.


clientConnectAddress

protected java.lang.String clientConnectAddress
The internet address client will use to connect to the sever.


serverBindAddress

protected java.lang.String serverBindAddress
The internet address to bind to by default.


serverBindPort

protected int serverBindPort
The server port to bind to.

Constructor Detail

SocketServerInvoker

public SocketServerInvoker(InvokerLocator (src)  locator)

SocketServerInvoker

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

getAddress

public java.net.InetAddress getAddress()

getPort

public int getPort()

setup

protected void setup()
              throws java.lang.Exception
Throws:
java.lang.Exception

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable

start

public void start()
           throws java.io.IOException
Starts the invoker.

Specified by:
start in interface SocketServerInvokerMBean (src)
Overrides:
start in class ServerInvoker (src)
Throws:
java.io.IOException

stop

public void stop()
Stops the invoker.

Specified by:
stop in interface SocketServerInvokerMBean (src)
Overrides:
stop in class ServerInvoker (src)

getMBeanObjectName

public java.lang.String getMBeanObjectName()
Description copied from class: ServerInvoker (src)
Returns the String for the object name to be used for the invoker.

Specified by:
getMBeanObjectName in class ServerInvoker (src)
Returns:

getSocketTimeout

public int getSocketTimeout()
Getter for property timeout

Specified by:
getSocketTimeout in interface SocketServerInvokerMBean (src)
Returns:
Value of property timeout

setSocketTimeout

public void setSocketTimeout(int time)
Setter for property timeout

Specified by:
setSocketTimeout in interface SocketServerInvokerMBean (src)
Parameters:
time - New value of property timeout

getCurrentThreadPoolSize

public int getCurrentThreadPoolSize()
Specified by:
getCurrentThreadPoolSize in interface SocketServerInvokerMBean (src)
Returns:
Value of property serverBindPort.

getCurrentClientPoolSize

public int getCurrentClientPoolSize()
Specified by:
getCurrentClientPoolSize in interface SocketServerInvokerMBean (src)
Returns:
Value of property serverBindPort.

getClientConnectAddress

public java.lang.String getClientConnectAddress()
Specified by:
getClientConnectAddress in interface SocketServerInvokerMBean (src)

setClientConnectAddress

public void setClientConnectAddress(java.lang.String clientConnectAddress)
This method should only be called by the service controller when this invoker is specified within the Connector configuration of a service xml. Calling this directly will have no effect, as will be used in building the locator uri that is published for detection and this happens when the invoker is first created and started (after that, no one will be aware of a change).

Specified by:
setClientConnectAddress in interface SocketServerInvokerMBean (src)

getNumAcceptThreads

public int getNumAcceptThreads()
Getter for property numAcceptThreads

Specified by:
getNumAcceptThreads in interface SocketServerInvokerMBean (src)
Returns:
The number of threads that exist for accepting client connections

setNumAcceptThreads

public void setNumAcceptThreads(int size)
Setter for property numAcceptThreads

Specified by:
setNumAcceptThreads in interface SocketServerInvokerMBean (src)
Parameters:
size - The number of threads that exist for accepting client connections

getMaxPoolSize

public int getMaxPoolSize()
Setter for max pool size. The number of server threads for processing client. The default is 300.

Specified by:
getMaxPoolSize in interface SocketServerInvokerMBean (src)
Returns:

setMaxPoolSize

public void setMaxPoolSize(int maxPoolSize)
The number of server threads for processing client. The default is 300.

Specified by:
setMaxPoolSize in interface SocketServerInvokerMBean (src)
Parameters:
maxPoolSize -

getServerBindAddress

public java.lang.String getServerBindAddress()
Specified by:
getServerBindAddress in interface SocketServerInvokerMBean (src)

setServerBindAddress

public void setServerBindAddress(java.lang.String serverBindAddress)
Specified by:
setServerBindAddress in interface SocketServerInvokerMBean (src)

getServerBindPort

public int getServerBindPort()
Getter for property serverBindPort.

Specified by:
getServerBindPort in interface SocketServerInvokerMBean (src)
Returns:
Value of property serverBindPort.

setServerBindPort

public void setServerBindPort(int serverBindPort)
Setter for property serverBindPort.

Specified by:
setServerBindPort in interface SocketServerInvokerMBean (src)
Parameters:
serverBindPort - New value of property serverBindPort.

getBacklog

public int getBacklog()
Specified by:
getBacklog in interface SocketServerInvokerMBean (src)

setBacklog

public void setBacklog(int backlog)
Specified by:
setBacklog in interface SocketServerInvokerMBean (src)

run

public void run()
Specified by:
run in interface java.lang.Runnable

isTransportBiDirectional

public boolean isTransportBiDirectional()
returns true if the transport is bi-directional in nature, for example, SOAP in unidirectional and SOCKETs are bi-directional (unless behind a firewall for example).

Specified by:
isTransportBiDirectional in interface ServerInvokerMBean (src)
Returns:

getDefaultDataType

protected java.lang.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.

Specified by:
getDefaultDataType in class ServerInvoker (src)
Returns: