org.jboss.invocation.jrmp.server
Class JRMPInvoker

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byorg.jboss.invocation.jrmp.server.JRMPInvoker
All Implemented Interfaces:
Invoker (src) , MBeanRegistration (src) , java.rmi.Remote, java.io.Serializable
Direct Known Subclasses:
JRMPInvokerHA (src)

public class JRMPInvoker
extends java.rmi.server.RemoteServer
implements Invoker (src) , MBeanRegistration (src)

The JRMPInvoker is an RMI implementation that can generate Invocations from RMI/JRMP into the JMX base.

See Also:
Serialized Form

Field Summary
static int ANONYMOUS_PORT
          Identifer to instruct the usage of an anonymous port.
protected  int backlog
          The socket accept backlog
protected  java.rmi.server.RMIClientSocketFactory clientSocketFactory
          An optional custom client socket factory
protected  java.lang.String clientSocketFactoryName
          The class name of the optional custom client socket factory
protected  boolean enableClassCaching
          A flag to enable caching of classes in the MarshalledValueInputStream
protected  java.rmi.server.RemoteStub invokerStub
           
protected  Logger (src) log
          Instance logger.
protected  int rmiPort
          The port the container will be exported on
protected  java.lang.String serverAddress
          The address to bind the rmi port on
protected  java.rmi.server.RMIServerSocketFactory serverSocketFactory
          An optional custom server socket factory
protected  java.lang.String serverSocketFactoryName
          The class name of the optional custom server socket factory
protected  java.lang.String sslDomain
          The name of the security domain to use with server sockets that support SSL
protected  ServiceMBeanSupport (src) support
          Service MBean support delegate.
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface org.jboss.invocation.Invoker (src)
ID
 
Constructor Summary
JRMPInvoker()
           
 
Method Summary
 void create()
           
protected  Invoker (src) createDelegateInvoker()
           
 void destroy()
           
protected  void destroyService()
           
protected  void exportCI()
           
 int getBacklog()
           
 boolean getEnableClassCaching()
           
 java.lang.String getName()
           
 java.lang.String getRMIClientSocketFactory()
           
 java.rmi.server.RMIClientSocketFactory getRMIClientSocketFactoryBean()
           
 int getRMIObjectPort()
           
 java.lang.String getRMIServerSocketFactory()
           
 java.rmi.server.RMIServerSocketFactory getRMIServerSocketFactoryBean()
           
 java.lang.String getSecurityDomain()
           
 MBeanServer (src) getServer()
           
 java.lang.String getServerAddress()
           
 java.lang.String getServerHostName()
          A free form String identifier for this delegate invoker, can be clustered or target node This should evolve in a more advanced meta-inf object
 int getState()
           
 java.lang.String getStateString()
           
 java.io.Serializable getStub()
           
protected  Transaction (src) importTPC(java.lang.Object tpc)
          Import a transaction propagation context into the local VM, and return the corresponding Transaction.
 java.lang.Object invoke(Invocation (src)  invocation)
          Invoke a Remote interface method.
 void jbossInternalLifecycle(java.lang.String method)
           
protected  void loadCustomSocketFactories()
          Load and instantiate the clientSocketFactory, serverSocketFactory using the TCL and set the bind address and SSL domain if the serverSocketFactory supports it.
 void postDeregister()
          This method is called by the MBeanServer after deregistration takes place.
 void postRegister(java.lang.Boolean registrationDone)
          This method is called by the MBeanServer after registration takes place or when registration fails.
 void preDeregister()
          This method is called by the MBeanServer before deregistration takes place.
 ObjectName (src) preRegister(MBeanServer (src)  server, ObjectName (src)  name)
          This method is called by the MBeanServer before registration takes place.
protected  void rebind(javax.naming.Context ctx, java.lang.String name, java.lang.Object val)
           
 void setBacklog(int back)
           
 void setEnableClassCaching(boolean flag)
           
 void setRMIClientSocketFactory(java.lang.String name)
           
 void setRMIClientSocketFactoryBean(java.rmi.server.RMIClientSocketFactory bean)
           
 void setRMIObjectPort(int rmiPort)
           
 void setRMIServerSocketFactory(java.lang.String name)
           
 void setRMIServerSocketFactoryBean(java.rmi.server.RMIServerSocketFactory bean)
           
 void setSecurityDomain(java.lang.String domainName)
           
 void setServerAddress(java.lang.String address)
           
 void start()
           
protected  void startService()
           
 void stop()
           
protected  void stopService()
           
protected  void unexportCI()
           
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ANONYMOUS_PORT

public static final int ANONYMOUS_PORT
Identifer to instruct the usage of an anonymous port.

See Also:
Constant Field Values (src)

log

protected Logger (src)  log
Instance logger.


support

protected ServiceMBeanSupport (src)  support
Service MBean support delegate.


rmiPort

protected int rmiPort
The port the container will be exported on


clientSocketFactory

protected java.rmi.server.RMIClientSocketFactory clientSocketFactory
An optional custom client socket factory


serverSocketFactory

protected java.rmi.server.RMIServerSocketFactory serverSocketFactory
An optional custom server socket factory


clientSocketFactoryName

protected java.lang.String clientSocketFactoryName
The class name of the optional custom client socket factory


serverSocketFactoryName

protected java.lang.String serverSocketFactoryName
The class name of the optional custom server socket factory


serverAddress

protected java.lang.String serverAddress
The address to bind the rmi port on


sslDomain

protected java.lang.String sslDomain
The name of the security domain to use with server sockets that support SSL


invokerStub

protected java.rmi.server.RemoteStub invokerStub

backlog

protected int backlog
The socket accept backlog


enableClassCaching

protected boolean enableClassCaching
A flag to enable caching of classes in the MarshalledValueInputStream

Constructor Detail

JRMPInvoker

public JRMPInvoker()
Method Detail

getBacklog

public int getBacklog()

setBacklog

public void setBacklog(int back)

getEnableClassCaching

public boolean getEnableClassCaching()

setEnableClassCaching

public void setEnableClassCaching(boolean flag)

getServerHostName

public java.lang.String getServerHostName()
Description copied from interface: Invoker (src)
A free form String identifier for this delegate invoker, can be clustered or target node This should evolve in a more advanced meta-inf object

Specified by:
getServerHostName in interface Invoker (src)
Returns:
The localhost name or null.

setRMIObjectPort

public void setRMIObjectPort(int rmiPort)

getRMIObjectPort

public int getRMIObjectPort()

setRMIClientSocketFactory

public void setRMIClientSocketFactory(java.lang.String name)

getRMIClientSocketFactory

public java.lang.String getRMIClientSocketFactory()

setRMIClientSocketFactoryBean

public void setRMIClientSocketFactoryBean(java.rmi.server.RMIClientSocketFactory bean)

getRMIClientSocketFactoryBean

public java.rmi.server.RMIClientSocketFactory getRMIClientSocketFactoryBean()

setRMIServerSocketFactory

public void setRMIServerSocketFactory(java.lang.String name)

getRMIServerSocketFactory

public java.lang.String getRMIServerSocketFactory()

setRMIServerSocketFactoryBean

public void setRMIServerSocketFactoryBean(java.rmi.server.RMIServerSocketFactory bean)

getRMIServerSocketFactoryBean

public java.rmi.server.RMIServerSocketFactory getRMIServerSocketFactoryBean()

setServerAddress

public void setServerAddress(java.lang.String address)

getServerAddress

public java.lang.String getServerAddress()

setSecurityDomain

public void setSecurityDomain(java.lang.String domainName)

getSecurityDomain

public java.lang.String getSecurityDomain()

getStub

public java.io.Serializable getStub()

startService

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

stopService

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

destroyService

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

invoke

public java.lang.Object invoke(Invocation (src)  invocation)
                        throws java.lang.Exception
Invoke a Remote interface method.

Specified by:
invoke in interface Invoker (src)
Parameters:
invocation - A pointer to the invocation object
Returns:
Return value of method invocation.
Throws:
java.lang.Exception - Failed to invoke method.

createDelegateInvoker

protected Invoker (src)  createDelegateInvoker()

exportCI

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

unexportCI

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

rebind

protected void rebind(javax.naming.Context ctx,
                      java.lang.String name,
                      java.lang.Object val)
               throws javax.naming.NamingException
Throws:
javax.naming.NamingException

loadCustomSocketFactories

protected void loadCustomSocketFactories()
Load and instantiate the clientSocketFactory, serverSocketFactory using the TCL and set the bind address and SSL domain if the serverSocketFactory supports it.


importTPC

protected Transaction (src)  importTPC(java.lang.Object tpc)
Import a transaction propagation context into the local VM, and return the corresponding Transaction.

Returns:
A transaction or null if no tpc.

getName

public java.lang.String getName()

getServer

public MBeanServer (src)  getServer()

getState

public int getState()

getStateString

public java.lang.String getStateString()

create

public void create()
            throws java.lang.Exception
Throws:
java.lang.Exception

start

public void start()
           throws java.lang.Exception
Throws:
java.lang.Exception

stop

public void stop()

destroy

public void destroy()

jbossInternalLifecycle

public void jbossInternalLifecycle(java.lang.String method)
                            throws java.lang.Exception
Throws:
java.lang.Exception

preRegister

public ObjectName (src)  preRegister(MBeanServer (src)  server,
                              ObjectName (src)  name)
                       throws java.lang.Exception
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer before registration takes place. The MBean is passed a reference of the MBeanServer it is about to be registered with. The MBean must return the ObjectName it will be registered with. The MBeanServer can pass a suggested object depending upon how the MBean is registered.

The MBean can stop the registration by throwing an exception.The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.

Specified by:
preRegister in interface MBeanRegistration (src)
Returns:
the actual ObjectName to register this MBean with.
Throws:
java.lang.Exception - for any error, the MBean is not registered.

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer after registration takes place or when registration fails.

Specified by:
postRegister in interface MBeanRegistration (src)
Parameters:
registrationDone - the MBeanServer passes true when the MBean was registered, false otherwise.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer before deregistration takes place.

The MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.

Specified by:
preDeregister in interface MBeanRegistration (src)
Throws:
java.lang.Exception

postDeregister

public void postDeregister()
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer after deregistration takes place.

Specified by:
postDeregister in interface MBeanRegistration (src)