org.jboss.invocation.jrmp.server
Class JRMPInvoker

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by org.jboss.invocation.jrmp.server.JRMPInvoker
All Implemented Interfaces:
Serializable, Remote, MBeanRegistration, Invoker, JRMPInvokerMBean, org.jboss.kernel.spi.dependency.KernelControllerContextAware, Service, ServiceMBean

public class JRMPInvoker
extends RemoteServer
implements Invoker, JRMPInvokerMBean, MBeanRegistration, org.jboss.kernel.spi.dependency.KernelControllerContextAware

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

Version:
$Revision: 79760 $
Author:
Scott Stark
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  RMIClientSocketFactory clientSocketFactory
          An optional custom client socket factory
protected  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  RemoteStub invokerStub
           
protected  org.jboss.logging.Logger log
          Instance logger.
protected  int rmiPort
          The port the container will be exported on
protected  String serverAddress
          The address to bind the rmi port on
protected  RMIServerSocketFactory serverSocketFactory
          An optional custom server socket factory
protected  String serverSocketFactoryName
          The class name of the optional custom server socket factory
protected  String sslDomain
          The name of the security domain to use with server sockets that support SSL
protected  ServiceMBeanSupport support
          Service MBean support delegate.
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface org.jboss.invocation.Invoker
ID
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
JRMPInvoker()
           
 
Method Summary
 void create()
           
protected  Invoker createDelegateInvoker()
           
 void destroy()
           
protected  void destroyService()
           
protected  void exportCI()
           
 int getBacklog()
           
 boolean getEnableClassCaching()
           
 String getName()
           
 String getRMIClientSocketFactory()
           
 RMIClientSocketFactory getRMIClientSocketFactoryBean()
           
 int getRMIObjectPort()
           
 String getRMIServerSocketFactory()
           
 RMIServerSocketFactory getRMIServerSocketFactoryBean()
           
 String getSecurityDomain()
           
 MBeanServer getServer()
           
 String getServerAddress()
           
 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()
           
 String getStateString()
           
 Serializable getStub()
           
protected  Transaction importTPC(Object tpc)
          Import a transaction propagation context into the local VM, and return the corresponding Transaction.
 Object invoke(Invocation invocation)
          Invoke a Remote interface method.
 void jbossInternalLifecycle(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 pojoCreate()
           
 void pojoDestroy()
           
 void pojoStart()
           
 void pojoStop()
           
 void postDeregister()
           
 void postRegister(Boolean registrationDone)
           
 void preDeregister()
           
 ObjectName preRegister(MBeanServer server, ObjectName name)
           
protected  void rebind(Context ctx, String name, Object val)
           
 void setBacklog(int back)
           
 void setEnableClassCaching(boolean flag)
           
 void setKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext context)
           
 void setRMIClientSocketFactory(String name)
           
 void setRMIClientSocketFactoryBean(RMIClientSocketFactory bean)
           
 void setRMIObjectPort(int rmiPort)
           
 void setRMIServerSocketFactory(String name)
           
 void setRMIServerSocketFactoryBean(RMIServerSocketFactory bean)
           
 void setSecurityDomain(String domainName)
           
 void setServerAddress(String address)
           
 void start()
           
protected  void startService()
           
 void stop()
           
protected  void stopService()
           
protected  void unexportCI()
           
 void unsetKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext context)
           
 
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

log

protected org.jboss.logging.Logger log
Instance logger.


support

protected ServiceMBeanSupport support
Service MBean support delegate.


rmiPort

protected int rmiPort
The port the container will be exported on


clientSocketFactory

protected RMIClientSocketFactory clientSocketFactory
An optional custom client socket factory


serverSocketFactory

protected RMIServerSocketFactory serverSocketFactory
An optional custom server socket factory


clientSocketFactoryName

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


serverSocketFactoryName

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


serverAddress

protected String serverAddress
The address to bind the rmi port on


sslDomain

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


invokerStub

protected 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()
Specified by:
getBacklog in interface JRMPInvokerMBean

setBacklog

public void setBacklog(int back)
Specified by:
setBacklog in interface JRMPInvokerMBean

getEnableClassCaching

public boolean getEnableClassCaching()
Specified by:
getEnableClassCaching in interface JRMPInvokerMBean

setEnableClassCaching

public void setEnableClassCaching(boolean flag)
Specified by:
setEnableClassCaching in interface JRMPInvokerMBean

getServerHostName

public String getServerHostName()
Description copied from interface: Invoker
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
Returns:
The localhost name or null.

setRMIObjectPort

public void setRMIObjectPort(int rmiPort)
Specified by:
setRMIObjectPort in interface JRMPInvokerMBean

getRMIObjectPort

public int getRMIObjectPort()
Specified by:
getRMIObjectPort in interface JRMPInvokerMBean

setRMIClientSocketFactory

public void setRMIClientSocketFactory(String name)
Specified by:
setRMIClientSocketFactory in interface JRMPInvokerMBean

getRMIClientSocketFactory

public String getRMIClientSocketFactory()
Specified by:
getRMIClientSocketFactory in interface JRMPInvokerMBean

setRMIClientSocketFactoryBean

public void setRMIClientSocketFactoryBean(RMIClientSocketFactory bean)
Specified by:
setRMIClientSocketFactoryBean in interface JRMPInvokerMBean

getRMIClientSocketFactoryBean

public RMIClientSocketFactory getRMIClientSocketFactoryBean()
Specified by:
getRMIClientSocketFactoryBean in interface JRMPInvokerMBean

setRMIServerSocketFactory

public void setRMIServerSocketFactory(String name)
Specified by:
setRMIServerSocketFactory in interface JRMPInvokerMBean

getRMIServerSocketFactory

public String getRMIServerSocketFactory()
Specified by:
getRMIServerSocketFactory in interface JRMPInvokerMBean

setRMIServerSocketFactoryBean

public void setRMIServerSocketFactoryBean(RMIServerSocketFactory bean)
Specified by:
setRMIServerSocketFactoryBean in interface JRMPInvokerMBean

getRMIServerSocketFactoryBean

public RMIServerSocketFactory getRMIServerSocketFactoryBean()
Specified by:
getRMIServerSocketFactoryBean in interface JRMPInvokerMBean

setServerAddress

public void setServerAddress(String address)
Specified by:
setServerAddress in interface JRMPInvokerMBean

getServerAddress

public String getServerAddress()
Specified by:
getServerAddress in interface JRMPInvokerMBean

setSecurityDomain

public void setSecurityDomain(String domainName)
Specified by:
setSecurityDomain in interface JRMPInvokerMBean

getSecurityDomain

public String getSecurityDomain()
Specified by:
getSecurityDomain in interface JRMPInvokerMBean

getStub

public Serializable getStub()

startService

protected void startService()
                     throws Exception
Throws:
Exception

stopService

protected void stopService()
                    throws Exception
Throws:
Exception

destroyService

protected void destroyService()
                       throws Exception
Throws:
Exception

invoke

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

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

createDelegateInvoker

protected Invoker createDelegateInvoker()

exportCI

protected void exportCI()
                 throws Exception
Throws:
Exception

unexportCI

protected void unexportCI()
                   throws Exception
Throws:
Exception

rebind

protected void rebind(Context ctx,
                      String name,
                      Object val)
               throws NamingException
Throws:
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 importTPC(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 String getName()
Specified by:
getName in interface ServiceMBean

getServer

public MBeanServer getServer()

getState

public int getState()
Specified by:
getState in interface ServiceMBean

getStateString

public String getStateString()
Specified by:
getStateString in interface ServiceMBean

create

public void create()
            throws Exception
Specified by:
create in interface Service
Throws:
Exception

start

public void start()
           throws Exception
Specified by:
start in interface Service
Throws:
Exception

stop

public void stop()
Specified by:
stop in interface Service

destroy

public void destroy()
Specified by:
destroy in interface Service

jbossInternalLifecycle

public void jbossInternalLifecycle(String method)
                            throws Exception
Specified by:
jbossInternalLifecycle in interface ServiceMBean
Throws:
Exception

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws Exception
Specified by:
preRegister in interface MBeanRegistration
Throws:
Exception

postRegister

public void postRegister(Boolean registrationDone)
Specified by:
postRegister in interface MBeanRegistration

preDeregister

public void preDeregister()
                   throws Exception
Specified by:
preDeregister in interface MBeanRegistration
Throws:
Exception

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface MBeanRegistration

setKernelControllerContext

public void setKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext context)
                                throws Exception
Specified by:
setKernelControllerContext in interface org.jboss.kernel.spi.dependency.KernelControllerContextAware
Throws:
Exception

unsetKernelControllerContext

public void unsetKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext context)
                                  throws Exception
Specified by:
unsetKernelControllerContext in interface org.jboss.kernel.spi.dependency.KernelControllerContextAware
Throws:
Exception

pojoCreate

public void pojoCreate()
                throws Exception
Throws:
Exception

pojoStart

public void pojoStart()
               throws Exception
Throws:
Exception

pojoStop

public void pojoStop()
              throws Exception
Throws:
Exception

pojoDestroy

public void pojoDestroy()
                 throws Exception
Throws:
Exception


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.