|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.remoting.AbstractInvoker org.jboss.remoting.ServerInvoker
public abstract class ServerInvoker
ServerInvoker is the server-side part of a remote Invoker. The ServerInvoker implementation is responsible for calling transport, depending on how the protocol receives the incoming data.
Nested Class Summary | |
---|---|
static class |
ServerInvoker.InvalidStateException
|
Nested classes/interfaces inherited from class org.jboss.remoting.AbstractInvoker |
---|
AbstractInvoker.CallbackLocatorHolder |
Field Summary | |
---|---|
static java.lang.String |
BLOCKING
The value associated with BLOCKING_MODE that indicates that pull callbacks should be obtained in blocking mode; |
static java.lang.String |
BLOCKING_MODE
The key to be used to determine if pull callbacks should be obtained in blocking or nonblocking mode |
static java.lang.String |
BLOCKING_TIMEOUT
The key value to use to specify timeout for getting callbacks in blocking mode |
protected java.util.Map |
callbackHandlers
|
static java.lang.String |
CLIENT_CONNECT_ADDRESS_KEY
Key for setting the addres the client invoker should connecto to. |
static java.lang.String |
CLIENT_CONNECT_PORT_KEY
key for setting the port the client invoker should connect to. |
static java.lang.String |
CLIENT_LEASE_PERIOD
Key used for setting the amount of time (in milliseconds) that a client should renew its lease. |
protected java.util.Map |
clientCallbackListener
|
static java.lang.String |
CONNECTION_LISTENER
|
protected ConnectionNotifier |
connectionNotifier
|
static int |
DEFAULT_BLOCKING_TIMEOUT
Default timeout for getting callbacks in blocking mode. |
static int |
DEFAULT_CLIENT_LEASE_PERIOD
The default lease period for clients. |
static int |
DEFAULT_TIMEOUT_PERIOD
The default timeout period for socket connections. |
protected java.util.Map |
handlers
|
static java.lang.String |
INVOKER_SESSION_ID
|
static int |
MAX_NUM_ONEWAY_THREADS
The max number of worker threads to be used in the pool for processing one way calls on the server side. |
static java.lang.String |
MAX_NUM_ONEWAY_THREADS_KEY
Key for the the maximum number of threads to be used in the thread pool for one way invocations (server side). |
static java.lang.String |
MAX_ONEWAY_THREAD_POOL_QUEUE_SIZE
Key for the configuration map that determines the queue size for waiting asynchronous invocations. |
static java.lang.String |
NONBLOCKING
The value associated with BLOCKING_MODE that indicates that pull callbacks should be obtained in nonblocking mode; |
static java.lang.String |
ONEWAY_THREAD_POOL_CLASS_KEY
Key for setting the setting the oneway thread pool to use. |
static java.lang.String |
REGISTER_CALLBACK_LISTENER
The key to use to specify if ServerInvokerCallbackHandlers should be registered as ConnectionListeners. |
protected boolean |
registerCallbackListeners
|
static java.lang.String |
SERVER_BIND_ADDRESS_KEY
Key for setting the address the server invoker should bind to. |
static java.lang.String |
SERVER_BIND_PORT_KEY
Key for setting the port the server invoker should bind to. |
static java.lang.String |
SERVER_SOCKET_FACTORY
Key for setting the value for the server socket factory to be used by the server invoker. |
protected javax.net.ServerSocketFactory |
serverSocketFactory
|
protected org.jboss.remoting.ServerInvoker.CallbackContainer |
singleCallbackContainer
|
protected ServerInvocationHandler |
singleHandler
|
protected boolean |
started
|
static java.lang.String |
TIMEOUT
Key for setting the timeout value (in milliseconds) for socket connections. |
protected boolean |
useClientConnectionIdentity
|
Fields inherited from class org.jboss.remoting.AbstractInvoker |
---|
classbyteloader, configuration, localServerLocators, locator, passConfigMapToMarshalFactory, serializationType, socketFactory, socketFactoryCreatedFromSSLParameters |
Constructor Summary | |
---|---|
ServerInvoker(InvokerLocator locator)
|
|
ServerInvoker(InvokerLocator locator,
java.util.Map configuration)
|
Method Summary | |
---|---|
void |
addConnectionListener(ConnectionListener listener)
|
ServerInvocationHandler |
addInvocationHandler(java.lang.String subsystem,
ServerInvocationHandler handler)
Add a server invocation handler for a particular subsystem. |
protected int |
assignPort()
|
void |
create()
|
protected javax.net.ServerSocketFactory |
createServerSocketFactory()
|
void |
destroy()
Destory the invoker permanently. |
protected ServerInvocationHandler |
findInvocationHandler(java.lang.String subsystem)
|
java.lang.String |
getClientConnectAddress()
|
int |
getClientConnectPort()
|
java.util.Map |
getConfiguration()
Gets the server invoker's transport specific configuration. |
ConnectionNotifier |
getConnectionNotifier()
|
java.lang.String |
getDataType()
Will get the data type for the marshaller factory so know which marshaller to get to marshal the data. |
protected abstract java.lang.String |
getDefaultDataType()
|
protected javax.net.ServerSocketFactory |
getDefaultServerSocketFactory()
Gets the default server socket factory to use for the server invoker. |
ServerInvocationHandler |
getInvocationHandler(java.lang.String subsystem)
Get a ServerInvocationHandler for a given subsystem type. |
ServerInvocationHandler[] |
getInvocationHandlers()
|
Lease |
getLease(java.lang.String sessionId)
|
long |
getLeasePeriod()
Gets the amount of time (in milliseconds) that a client should renew its lease. |
int |
getMaxNumberOfOnewayThreads()
Gets the maximum number of thread to be used in the thread pool for one way invocations (server side). |
java.lang.String |
getMBeanObjectName()
|
javax.management.MBeanServer |
getMBeanServer()
|
org.jboss.util.threadpool.ThreadPool |
getOnewayThreadPool()
Gets the oneway thread pool to use. |
java.lang.String |
getServerBindAddress()
|
int |
getServerBindPort()
|
javax.net.ServerSocketFactory |
getServerSocketFactory()
|
java.lang.String[] |
getSupportedSubsystems()
|
int |
getTimeout()
The timeout (in milliseconds) used for the socket connection. |
protected java.lang.Object |
handleInternalInvocation(InternalInvocation param,
InvocationRequest invocation,
ServerInvocationHandler handler)
Handles both internal and external invocations (internal meaning only to be used within remoting and external for ones that go to handlers. |
boolean |
hasInvocationHandler(java.lang.String subsystem)
|
java.lang.Object |
invoke(InvocationRequest invocation)
Processes invocation request depending on the invocation type (internal, name based, oneway, etc). |
java.lang.Object |
invoke(java.lang.Object invoke)
|
boolean |
isLeaseActivated()
|
boolean |
isRegisterCallbackListeners()
|
boolean |
isStarted()
return true if the server invoker is started, false if not |
protected boolean |
isUseClientConnectionIdentity()
|
protected boolean |
justNeedsSSLClientMode(java.util.Map configuration)
|
protected void |
postProcess(java.lang.String sessionId,
java.lang.Object param,
java.util.Map payload,
InvokerLocator locator)
Called after an invocation. |
protected void |
preProcess(java.lang.String sessionId,
ClassBytes arg,
java.util.Map payload,
InvokerLocator locator)
Called prior to an invocation. |
ServerInvokerCallbackHandler |
removeCallbackHandler(InvocationRequest invocation)
|
void |
removeCallbackListener(java.lang.String subsystem,
InvokerCallbackHandler callbackHandler)
|
void |
removeConnectionListener(ConnectionListener listener)
|
ServerInvocationHandler |
removeInvocationHandler(java.lang.String subsystem)
Remove a subsystem invocation handler. |
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 |
setClientConnectPort(int clientConnectPort)
|
void |
setConfiguration(java.util.Map configuration)
Sets the server invoker's transport specific configuration. |
void |
setConnectionListener(java.lang.Object listener)
|
void |
setLeasePeriod(long leasePeriodValue)
Sets the amount of time (in milliseconds) that a client should renew its lease. |
void |
setMaxNumberOfOnewayThreads(int numOfThreads)
Sets the maximum number of thread to be used in the thread pool for one way invocations (server side). |
void |
setMBeanServer(javax.management.MBeanServer server)
|
void |
setOnewayThreadPool(org.jboss.util.threadpool.ThreadPool pool)
Sets the oneway thread pool to use. |
void |
setRegisterCallbackListeners(boolean registerCallbackListeners)
|
void |
setServerSocketFactory(javax.net.ServerSocketFactory serverSocketFactory)
|
void |
setTimeout(int timeout)
Sets timeout (in millseconds) to be used for the socket connection. |
protected void |
setup()
|
protected void |
setUseClientConnectionIdentity(boolean useClientConnectionIdentity)
|
void |
shutdownCallbackHandler(ServerInvokerCallbackHandler callbackHandler,
InvocationRequest invocation)
|
void |
start()
Subclasses should override to provide any specific start logic. |
void |
stop()
Subclasses should override to provide any specific stop logic. |
protected javax.net.ServerSocketFactory |
wrapServerSocketFactory(javax.net.ServerSocketFactory ssf,
java.util.Map config)
|
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.remoting.ServerInvokerMBean |
---|
isTransportBiDirectional |
Field Detail |
---|
public static final java.lang.String MAX_NUM_ONEWAY_THREADS_KEY
public static final java.lang.String ONEWAY_THREAD_POOL_CLASS_KEY
public static final java.lang.String SERVER_BIND_ADDRESS_KEY
public static final java.lang.String CLIENT_CONNECT_ADDRESS_KEY
public static final java.lang.String SERVER_BIND_PORT_KEY
public static final java.lang.String CLIENT_CONNECT_PORT_KEY
public static final java.lang.String CLIENT_LEASE_PERIOD
public static final java.lang.String TIMEOUT
public static final java.lang.String SERVER_SOCKET_FACTORY
public static final int MAX_NUM_ONEWAY_THREADS
public static final java.lang.String MAX_ONEWAY_THREAD_POOL_QUEUE_SIZE
public static final int DEFAULT_CLIENT_LEASE_PERIOD
public static final int DEFAULT_TIMEOUT_PERIOD
public static final java.lang.String BLOCKING_MODE
public static final java.lang.String BLOCKING_TIMEOUT
public static final java.lang.String BLOCKING
public static final java.lang.String NONBLOCKING
public static final int DEFAULT_BLOCKING_TIMEOUT
public static final java.lang.String REGISTER_CALLBACK_LISTENER
public static final java.lang.String INVOKER_SESSION_ID
public static final java.lang.String CONNECTION_LISTENER
protected java.util.Map handlers
protected volatile ServerInvocationHandler singleHandler
protected volatile org.jboss.remoting.ServerInvoker.CallbackContainer singleCallbackContainer
protected java.util.Map callbackHandlers
protected java.util.Map clientCallbackListener
protected boolean started
protected ConnectionNotifier connectionNotifier
protected javax.net.ServerSocketFactory serverSocketFactory
protected boolean registerCallbackListeners
protected boolean useClientConnectionIdentity
Constructor Detail |
---|
public ServerInvoker(InvokerLocator locator)
public ServerInvoker(InvokerLocator locator, java.util.Map configuration)
Method Detail |
---|
public void setServerSocketFactory(javax.net.ServerSocketFactory serverSocketFactory)
public javax.net.ServerSocketFactory getServerSocketFactory()
public void setTimeout(int timeout)
setTimeout
in interface ServerInvokerMBean
public int getTimeout()
getTimeout
in interface ServerInvokerMBean
public ConnectionNotifier getConnectionNotifier()
public boolean isLeaseActivated()
public void addConnectionListener(ConnectionListener listener)
public void setConnectionListener(java.lang.Object listener)
public void removeConnectionListener(ConnectionListener listener)
public void setLeasePeriod(long leasePeriodValue)
public Lease getLease(java.lang.String sessionId)
public long getLeasePeriod()
public java.lang.String getClientConnectAddress()
getClientConnectAddress
in interface ServerInvokerMBean
public int getClientConnectPort()
getClientConnectPort
in interface ServerInvokerMBean
public void setClientConnectPort(int clientConnectPort)
setClientConnectPort
in interface ServerInvokerMBean
public void setClientConnectAddress(java.lang.String clientConnectAddress)
setClientConnectAddress
in interface ServerInvokerMBean
public java.lang.String getServerBindAddress()
getServerBindAddress
in interface ServerInvokerMBean
public int getServerBindPort()
getServerBindPort
in interface ServerInvokerMBean
public void setMaxNumberOfOnewayThreads(int numOfThreads)
public int getMaxNumberOfOnewayThreads()
public org.jboss.util.threadpool.ThreadPool getOnewayThreadPool()
public void setOnewayThreadPool(org.jboss.util.threadpool.ThreadPool pool)
public javax.management.MBeanServer getMBeanServer()
public void setMBeanServer(javax.management.MBeanServer server)
public boolean isRegisterCallbackListeners()
public void setRegisterCallbackListeners(boolean registerCallbackListeners)
public boolean hasInvocationHandler(java.lang.String subsystem)
public java.lang.String[] getSupportedSubsystems()
public ServerInvocationHandler[] getInvocationHandlers()
public ServerInvocationHandler addInvocationHandler(java.lang.String subsystem, ServerInvocationHandler handler)
public ServerInvocationHandler removeInvocationHandler(java.lang.String subsystem)
public ServerInvocationHandler getInvocationHandler(java.lang.String subsystem)
protected boolean isUseClientConnectionIdentity()
protected void setUseClientConnectionIdentity(boolean useClientConnectionIdentity)
public java.lang.Object invoke(java.lang.Object invoke) throws java.io.IOException
java.io.IOException
public java.lang.Object invoke(InvocationRequest invocation) throws java.lang.Throwable
java.lang.Throwable
public java.lang.String getDataType()
getDataType
in interface ServerInvokerMBean
public void create()
create
in interface ServerInvokerMBean
public void start() throws java.io.IOException
start
in interface ServerInvokerMBean
java.io.IOException
public boolean isStarted()
ServerInvokerMBean
isStarted
in interface ServerInvokerMBean
public void stop()
stop
in interface ServerInvokerMBean
public void destroy()
destroy
in interface ServerInvokerMBean
public void setConfiguration(java.util.Map configuration)
setConfiguration
in interface ServerInvokerMBean
public java.util.Map getConfiguration()
getConfiguration
in interface ServerInvokerMBean
getConfiguration
in class AbstractInvoker
public void removeCallbackListener(java.lang.String subsystem, InvokerCallbackHandler callbackHandler)
public java.lang.String getMBeanObjectName()
protected abstract java.lang.String getDefaultDataType()
protected void setup() throws java.lang.Exception
java.lang.Exception
protected int assignPort() throws java.io.IOException
java.io.IOException
protected javax.net.ServerSocketFactory createServerSocketFactory() throws java.io.IOException
java.io.IOException
protected boolean justNeedsSSLClientMode(java.util.Map configuration)
protected javax.net.ServerSocketFactory getDefaultServerSocketFactory() throws java.io.IOException
java.io.IOException
protected javax.net.ServerSocketFactory wrapServerSocketFactory(javax.net.ServerSocketFactory ssf, java.util.Map config)
protected java.lang.Object handleInternalInvocation(InternalInvocation param, InvocationRequest invocation, ServerInvocationHandler handler) throws java.lang.Throwable
java.lang.Throwable
protected ServerInvocationHandler findInvocationHandler(java.lang.String subsystem)
protected void preProcess(java.lang.String sessionId, ClassBytes arg, java.util.Map payload, InvokerLocator locator)
protected void postProcess(java.lang.String sessionId, java.lang.Object param, java.util.Map payload, InvokerLocator locator)
public ServerInvokerCallbackHandler removeCallbackHandler(InvocationRequest invocation)
public void shutdownCallbackHandler(ServerInvokerCallbackHandler callbackHandler, InvocationRequest invocation)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |