|
||||||||||
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.ServerInvoker
org.jboss.remoting.transport.socket.SocketServerInvoker
public class SocketServerInvoker
SocketServerInvoker is the server-side of a SOCKET based transport
Nested Class Summary | |
---|---|
class |
SocketServerInvoker.IdleTimerTask
The IdleTimerTask is used to periodically check the server threads to see if any have been idle for a specified amount of time, and if so, release those threads and their connections and clear from the server thread pool. |
class |
SocketServerInvoker.ServerSocketRefresh
this thread checks if a new ServerSocketFactory was set, if so initializes a serversocket refresh |
Nested classes/interfaces inherited from class org.jboss.remoting.ServerInvoker |
---|
ServerInvoker.InvalidStateException |
Nested classes/interfaces inherited from class org.jboss.remoting.AbstractInvoker |
---|
AbstractInvoker.CallbackLocatorHolder |
Field Summary | |
---|---|
protected java.lang.Thread[] |
acceptThreads
|
protected int |
backlog
|
static java.lang.String |
CHECK_CONNECTION_KEY
Key for indicating if socket invoker should continue to keep socket connection between client and server open after invocations by sending a ping on the connection before being re-used. |
protected LRUPool |
clientpool
|
protected int |
idleTimeout
|
protected SocketServerInvoker.IdleTimerTask |
idleTimerTask
|
protected static int |
MAX_POOL_SIZE_DEFAULT
|
protected int |
maxPoolSize
|
protected boolean |
newServerSocketFactory
|
protected int |
numAcceptThreads
|
protected boolean |
reuseAddress
|
protected boolean |
running
|
static java.lang.String |
SERVER_SOCKET_CLASS_FLAG
Specifies the fully qualified class name for the custom SocketWrapper implementation to use on the server. |
protected java.net.ServerSocket |
serverSocket
|
protected java.lang.String |
serverSocketClass
|
protected java.lang.Object |
serverSocketFactoryLock
|
protected java.util.LinkedList |
threadpool
|
Fields inherited from class org.jboss.remoting.AbstractInvoker |
---|
classbyteloader, configuration, localServerLocators, locator, passConfigMapToMarshalFactory, serializationType, socketFactory, socketFactoryCreatedFromSSLParameters |
Constructor Summary | |
---|---|
SocketServerInvoker(InvokerLocator locator)
|
|
SocketServerInvoker(InvokerLocator locator,
java.util.Map configuration)
|
Method Summary | |
---|---|
protected void |
cleanup()
|
protected java.net.ServerSocket |
createServerSocket(int serverBindPort,
int backlog,
java.net.InetAddress bindAddress)
|
void |
destroy()
Destory the invoker permanently. |
protected void |
finalize()
|
int |
getBacklog()
|
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 |
getIdleTimeout()
|
int |
getMaxPoolSize()
Setter for max pool size. |
int |
getNumAcceptThreads()
Getter for property numAcceptThreads |
boolean |
getReuseAddress()
Indicates if SO_REUSEADDR is enabled on server sockets Default is true. |
protected java.lang.String |
getThreadName(int i)
|
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). |
protected void |
processInvocation(java.net.Socket socket)
The acceptor thread should spend as little time as possbile doing any kind of operation, and under no circumstances should perform IO on the new socket, which can potentially block and lock up the server. |
protected void |
refreshServerSocket()
refreshes the serverSocket by closing old one and creating a new ServerSocket from new ServerSocketFactory |
void |
run()
|
void |
setBacklog(int backlog)
|
void |
setIdleTimeout(int idleTimeout)
Sets the timeout for idle threads to be removed from pool. |
void |
setMaxPoolSize(int maxPoolSize)
The number of server threads for processing client. |
void |
setNewServerSocketFactory(javax.net.ServerSocketFactory serverSocketFactory)
after a truststore update use this to set a new ServerSocketFactory to the invoker then a new ServerSocket is created that accepts the new connections |
void |
setNumAcceptThreads(int size)
Setter for property numAcceptThreads |
void |
setReuseAddress(boolean reuse)
Sets if SO_REUSEADDR is enabled on server sockets. |
protected void |
setup()
|
void |
start()
Starts the invoker. |
void |
stop()
Stops the invoker. |
java.lang.String |
toString()
|
Methods inherited from class org.jboss.remoting.AbstractInvoker |
---|
addClientLocator, createSocketFactory, getClassLoader, getClientLocator, getClientLocators, 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.socket.SocketServerInvokerMBean |
---|
getServerBindPort |
Methods inherited from interface org.jboss.remoting.ServerInvokerMBean |
---|
create, getClientConnectAddress, getClientConnectPort, getConfiguration, getDataType, getServerBindAddress, getTimeout, isStarted, setClientConnectAddress, setClientConnectPort, setConfiguration, setTimeout |
Field Detail |
---|
protected static int MAX_POOL_SIZE_DEFAULT
public static final java.lang.String CHECK_CONNECTION_KEY
public static final java.lang.String SERVER_SOCKET_CLASS_FLAG
protected java.lang.String serverSocketClass
protected java.net.ServerSocket serverSocket
protected boolean running
protected int backlog
protected java.lang.Thread[] acceptThreads
protected int numAcceptThreads
protected int maxPoolSize
protected LRUPool clientpool
protected java.util.LinkedList threadpool
protected boolean newServerSocketFactory
protected java.lang.Object serverSocketFactoryLock
protected boolean reuseAddress
protected int idleTimeout
protected SocketServerInvoker.IdleTimerTask idleTimerTask
Constructor Detail |
---|
public SocketServerInvoker(InvokerLocator locator)
public SocketServerInvoker(InvokerLocator locator, java.util.Map configuration)
Method Detail |
---|
public void setNewServerSocketFactory(javax.net.ServerSocketFactory serverSocketFactory)
serverSocketFactory
- protected void refreshServerSocket() throws java.io.IOException
java.io.IOException
protected void setup() throws java.lang.Exception
setup
in class ServerInvoker
java.lang.Exception
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void start() throws java.io.IOException
start
in interface ServerInvokerMBean
start
in interface SocketServerInvokerMBean
start
in class ServerInvoker
java.io.IOException
protected java.net.ServerSocket createServerSocket(int serverBindPort, int backlog, java.net.InetAddress bindAddress) throws java.io.IOException
java.io.IOException
protected java.lang.String getThreadName(int i)
public void destroy()
ServerInvoker
destroy
in interface ServerInvokerMBean
destroy
in class ServerInvoker
public void stop()
stop
in interface ServerInvokerMBean
stop
in interface SocketServerInvokerMBean
stop
in class ServerInvoker
protected void cleanup()
public boolean getReuseAddress()
public void setReuseAddress(boolean reuse)
reuse
- public int getCurrentThreadPoolSize()
getCurrentThreadPoolSize
in interface SocketServerInvokerMBean
public int getCurrentClientPoolSize()
getCurrentClientPoolSize
in interface SocketServerInvokerMBean
public int getNumAcceptThreads()
getNumAcceptThreads
in interface SocketServerInvokerMBean
public void setNumAcceptThreads(int size)
setNumAcceptThreads
in interface SocketServerInvokerMBean
size
- The number of threads that exist for accepting client connectionspublic int getMaxPoolSize()
getMaxPoolSize
in interface SocketServerInvokerMBean
public void setMaxPoolSize(int maxPoolSize)
setMaxPoolSize
in interface SocketServerInvokerMBean
maxPoolSize
- public int getBacklog()
getBacklog
in interface SocketServerInvokerMBean
public void setBacklog(int backlog)
setBacklog
in interface SocketServerInvokerMBean
public int getIdleTimeout()
public void setIdleTimeout(int idleTimeout)
idleTimeout
- number of seconds before a idle thread is timed out.public void run()
run
in interface java.lang.Runnable
protected void processInvocation(java.net.Socket socket) throws java.lang.Exception
java.lang.Exception
public boolean isTransportBiDirectional()
isTransportBiDirectional
in interface ServerInvokerMBean
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String getDefaultDataType()
getDefaultDataType
in class ServerInvoker
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |