org.jboss.remoting.transport.socket
Class SocketServerInvoker

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

public class SocketServerInvoker
extends ServerInvoker
implements Runnable, SocketServerInvokerMBean

SocketServerInvoker is the server-side of a SOCKET based transport

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

Field Summary
protected  Thread[] acceptThreads
           
protected  int backlog
           
protected  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 clientpool
           
protected  int maxPoolSize
           
protected  int numAcceptThreads
           
protected  boolean running
           
protected  String serverBindAddress
          The internet address to bind to by default.
protected  int serverBindPort
          The server port to bind to.
protected  ServerSocket serverSocket
           
protected  LinkedList threadpool
           
protected  int timeout
           
protected  boolean trace
          The logging trace level flag
 
Fields inherited from class org.jboss.remoting.ServerInvoker
callbackHandlers, handlers, MAX_NUM_ONEWAY_THREADS
 
Fields inherited from class org.jboss.remoting.AbstractInvoker
classbyteloader, localServerLocator, locator, log
 
Constructor Summary
SocketServerInvoker(InvokerLocator locator)
           
SocketServerInvoker(InvokerLocator locator, Map configuration)
           
 
Method Summary
protected  void finalize()
           
 InetAddress getAddress()
           
 int getBacklog()
           
 String getClientConnectAddress()
           
 int getCurrentClientPoolSize()
           
 int getCurrentThreadPoolSize()
           
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 getMaxPoolSize()
          Setter for max pool size.
 int getNumAcceptThreads()
          Getter for property numAcceptThreads
 int getPort()
           
 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(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(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
addInvocationHandler, destroy, getConfiguration, getDataType, getInvocationHandler, getInvocationHandlers, getMBeanObjectName, getMBeanServer, getSupportedSubsystems, hasInvocationHandler, invoke, invoke, isStarted, postProcess, preProcess, removeInvocationHandler, setConfigration, setMBeanServer
 
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.ServerInvokerMBean
destroy, getConfiguration, getDataType, isStarted, setConfigration
 

Field Detail

serverSocket

protected ServerSocket serverSocket

running

protected boolean running

backlog

protected int backlog

acceptThreads

protected Thread[] acceptThreads

numAcceptThreads

protected int numAcceptThreads

maxPoolSize

protected int maxPoolSize

clientpool

protected LRUPool clientpool

threadpool

protected 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 String clientConnectAddress
The internet address client will use to connect to the sever.


serverBindAddress

protected 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 locator)

SocketServerInvoker

public SocketServerInvoker(InvokerLocator locator,
                           Map configuration)
Method Detail

getAddress

public InetAddress getAddress()

getPort

public int getPort()

setup

protected void setup()
              throws Exception
Throws:
Exception

finalize

protected void finalize()
                 throws Throwable
Throws:
Throwable

start

public void start()
           throws IOException
Starts the invoker.

Specified by:
start in interface SocketServerInvokerMBean
Overrides:
start in class ServerInvoker
Throws:
IOException

stop

public void stop()
Stops the invoker.

Specified by:
stop in interface SocketServerInvokerMBean
Overrides:
stop in class ServerInvoker

getSocketTimeout

public int getSocketTimeout()
Getter for property timeout

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

setSocketTimeout

public void setSocketTimeout(int time)
Setter for property timeout

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

getCurrentThreadPoolSize

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

getCurrentClientPoolSize

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

getClientConnectAddress

public String getClientConnectAddress()
Specified by:
getClientConnectAddress in interface SocketServerInvokerMBean

setClientConnectAddress

public void setClientConnectAddress(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

getNumAcceptThreads

public int getNumAcceptThreads()
Getter for property numAcceptThreads

Specified by:
getNumAcceptThreads in interface SocketServerInvokerMBean
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
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
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
Parameters:
maxPoolSize -

getServerBindAddress

public String getServerBindAddress()
Specified by:
getServerBindAddress in interface SocketServerInvokerMBean

setServerBindAddress

public void setServerBindAddress(String serverBindAddress)
Specified by:
setServerBindAddress in interface SocketServerInvokerMBean

getServerBindPort

public int getServerBindPort()
Getter for property serverBindPort.

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

setServerBindPort

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

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

getBacklog

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

setBacklog

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

run

public void run()
Specified by:
run in interface 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
Returns:

getDefaultDataType

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.

Specified by:
getDefaultDataType in class ServerInvoker
Returns:


Copyright © 2004 JBoss Inc. All Rights Reserved.