|
||||||||||
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.AcceptThread
|
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 SocketServerInvoker.AcceptThread[] |
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 boolean |
keepAlive
More socket configuration parameters. |
protected boolean |
keepAliveSet
|
protected static int |
MAX_POOL_SIZE_DEFAULT
|
protected int |
maxPoolSize
|
protected boolean |
newServerSocketFactory
|
protected int |
numAcceptThreads
|
protected boolean |
oOBInline
|
protected boolean |
oOBInlineSet
|
protected java.util.Properties |
props
|
protected int |
receiveBufferSize
|
protected SocketServerInvoker.ServerSocketRefresh |
refreshThread
|
protected boolean |
reuseAddress
|
protected boolean |
running
|
protected int |
sendBufferSize
|
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.lang.String |
serverSocketClass
|
protected java.lang.Object |
serverSocketFactoryLock
|
protected java.util.List |
serverSockets
|
protected boolean |
soLinger
|
protected int |
soLingerDuration
|
protected boolean |
soLingerSet
|
protected java.util.LinkedList |
threadpool
|
protected int |
trafficClass
|
Fields inherited from class org.jboss.remoting.AbstractInvoker |
---|
classbyteloader, configuration, localServerLocators, locator, serializationType, socketFactory, socketFactoryCreatedFromSSLParameters, version |
Constructor Summary | |
---|---|
SocketServerInvoker(InvokerLocator locator)
|
|
SocketServerInvoker(InvokerLocator locator,
java.util.Map configuration)
|
Method Summary | |
---|---|
protected void |
cleanup()
|
protected void |
configureServerSocket(java.net.ServerSocket ss)
|
protected void |
configureSocket(java.net.Socket s)
|
protected java.net.ServerSocket |
createServerSocket(int serverBindPort,
int backlog,
java.net.InetAddress bindAddress)
|
protected void |
createServerSockets()
|
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 |
int |
getReceiveBufferSize()
|
boolean |
getReuseAddress()
Indicates if SO_REUSEADDR is enabled on server sockets Default is true. |
int |
getSendBufferSize()
|
int |
getSoLingerDuration()
|
protected java.lang.String |
getThreadName(int i)
|
int |
getTrafficClass()
|
boolean |
isKeepAlive()
|
boolean |
isOOBInline()
|
boolean |
isSoLinger()
|
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 |
setBacklog(int backlog)
|
void |
setIdleTimeout(int idleTimeout)
Sets the timeout for idle threads to be removed from pool. |
void |
setKeepAlive(boolean keepAlive)
|
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 |
setOOBInline(boolean inline)
|
void |
setReceiveBufferSize(int receiveBufferSize)
|
void |
setReuseAddress(boolean reuse)
Sets if SO_REUSEADDR is enabled on server sockets. |
void |
setSendBufferSize(int sendBufferSize)
|
void |
setSoLinger(boolean soLinger)
|
void |
setSoLingerDuration(int soLingerDuration)
|
void |
setTrafficClass(int trafficClass)
|
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, getVersion, isCompleteSocketFactory, isSocketFactoryCreatedFromSSLParameters, needsCustomSSLConfiguration, setClassLoader, setSerializationType, setSocketFactory, setVersion, 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 java.util.Properties props
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.util.List serverSockets
protected boolean running
protected int backlog
protected SocketServerInvoker.AcceptThread[] acceptThreads
protected int numAcceptThreads
protected int maxPoolSize
protected LRUPool clientpool
protected java.util.LinkedList threadpool
protected SocketServerInvoker.ServerSocketRefresh refreshThread
protected boolean newServerSocketFactory
protected java.lang.Object serverSocketFactoryLock
protected boolean reuseAddress
protected int receiveBufferSize
protected boolean keepAlive
protected boolean keepAliveSet
protected boolean oOBInline
protected boolean oOBInlineSet
protected int sendBufferSize
protected boolean soLinger
protected boolean soLingerSet
protected int soLingerDuration
protected int trafficClass
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 void createServerSockets() throws java.io.IOException
java.io.IOException
protected void configureServerSocket(java.net.ServerSocket ss) throws java.net.SocketException
java.net.SocketException
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 int getReceiveBufferSize()
public void setReceiveBufferSize(int receiveBufferSize)
public boolean getReuseAddress()
public void setReuseAddress(boolean reuse)
reuse
- public boolean isKeepAlive()
public void setKeepAlive(boolean keepAlive)
public boolean isOOBInline()
public void setOOBInline(boolean inline)
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 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.protected void configureSocket(java.net.Socket s) throws java.net.SocketException
java.net.SocketException
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 |