mx4j.adaptor.rmi
Class RMIAdaptor

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--mx4j.adaptor.rmi.RMIAdaptor
All Implemented Interfaces:
Invocable, MBeanRegistration, java.rmi.Remote, RemoteAdaptor, RMIAdaptorMBean, java.io.Serializable
Direct Known Subclasses:
IIOPAdaptor, JRMPAdaptor

public abstract class RMIAdaptor
extends java.rmi.server.RemoteObject
implements RMIAdaptorMBean, MBeanRegistration, RemoteAdaptor

The RMI adaptor MBean, base for the JRMP and IIOP protocol

Version:
$Revision: 1.14 $
Author:
Simone Bordet
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
RMIAdaptor()
           
 
Method Summary
 void addInterceptor(Interceptor interceptor)
          Adds an interceptor to this RMI adaptor
protected  void bind(java.lang.Object adaptor)
           
 void clearJNDIProperties()
          Resets the JNDI properties set for this adaptor.
 void clearNamingProperties()
          Deprecated. Replaced by clearJNDIProperties()
 java.lang.String getHostAddress()
          Returns the host address on which this adaptor is running
 java.lang.String getHostName()
          Returns the host name on which this adaptor is running
 java.lang.String getJNDIName()
          Returns the JNDI name under which this RMI Adaptor is registered
 java.util.Properties getJNDIProperties()
          Returns the JNDI properties for this adaptor.
protected  MBeanServer getMBeanServer()
           
 java.util.Properties getNamingProperties()
          Deprecated. Replaced by getJNDIProperties()
protected  ObjectName getObjectName()
           
abstract  java.lang.String getProtocol()
          Returns the protocol of this adaptor
protected  void installInterceptors()
           
 InvocationResult invoke(Invocation invocation)
          Invocation method
abstract  boolean isRunning()
          Returns whether this adaptor has been started and not been stopped.
 void postDeregister()
          Called upon after the MBean has been de-registered.
 void postRegister(java.lang.Boolean registrationDone)
          Called upon after a registration ( successful or not ).
 void preDeregister()
          Called upon before an MBean will be de-registered by the MBeanServer.
 ObjectName preRegister(MBeanServer server, ObjectName name)
          Allows the MBean to perform any operations before being registered to the MBeanServer.
 void putJNDIProperty(java.lang.Object property, java.lang.Object value)
          Puts a JNDI property in the environment for the JNDI Initial Context used by this adaptor.
 void putNamingProperty(java.lang.Object property, java.lang.Object value)
          Deprecated. Replaced by {link #putJNDIProperty}
 void setJNDIName(java.lang.String name)
          Sets the JNDI name under which the RMI adaptor should be registered.
 void setMBeanServer(MBeanServer server)
          Sets the target MBeanServer in case this adaptor is not registered with it
abstract  void start()
          Starts this adaptor, so that it can accept incoming calls
abstract  void stop()
          Stops this adaptor, so that it does not accept incoming calls anymore
protected  void unbind()
           
protected  void uninstallInterceptors()
           
 
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
 

Constructor Detail

RMIAdaptor

public RMIAdaptor()
Method Detail

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws java.lang.Exception
Description copied from interface: MBeanRegistration
Allows the MBean to perform any operations before being registered to the MBeanServer.

Any exception will cause the MBean not being registered.

Specified by:
preRegister in interface MBeanRegistration
Parameters:
server - The MBeanServer on which the MBean will be registered.
name - The ObjectName of the MBean.
Returns:
ObjectName The name of the registered MBean
Throws:
java.lang.Exception - Exception of the operation. Note that this is caught by the MBeanServer and re-thrown as an MBeanRegistrationException.

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Description copied from interface: MBeanRegistration
Called upon after a registration ( successful or not ).

Specified by:
postRegister in interface MBeanRegistration
Parameters:
registrationDone - Evaluates to true of the registrations is successful, false otherwise.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Description copied from interface: MBeanRegistration
Called upon before an MBean will be de-registered by the MBeanServer.

Specified by:
preDeregister in interface MBeanRegistration
Throws:
java.lang.Exception - Would be caught by the MBeanServer and rethrown as an MBeanRegistrationException.

postDeregister

public void postDeregister()
Description copied from interface: MBeanRegistration
Called upon after the MBean has been de-registered.

Specified by:
postDeregister in interface MBeanRegistration

start

public abstract void start()
                    throws java.lang.Exception
Starts this adaptor, so that it can accept incoming calls

Specified by:
start in interface RMIAdaptorMBean
java.lang.Exception
See Also:
stop(), isRunning()

stop

public abstract void stop()
                   throws java.lang.Exception
Stops this adaptor, so that it does not accept incoming calls anymore

Specified by:
stop in interface RMIAdaptorMBean
java.lang.Exception
See Also:
start()

isRunning

public abstract boolean isRunning()
Returns whether this adaptor has been started and not been stopped.

Specified by:
isRunning in interface RMIAdaptorMBean
See Also:
stop()

getProtocol

public abstract java.lang.String getProtocol()
Returns the protocol of this adaptor

Specified by:
getProtocol in interface RMIAdaptorMBean

getJNDIName

public java.lang.String getJNDIName()
Returns the JNDI name under which this RMI Adaptor is registered

Specified by:
getJNDIName in interface RMIAdaptorMBean

setJNDIName

public void setJNDIName(java.lang.String name)
Sets the JNDI name under which the RMI adaptor should be registered.
This method can be called only if this adaptor is not running.

Specified by:
setJNDIName in interface RMIAdaptorMBean

putJNDIProperty

public void putJNDIProperty(java.lang.Object property,
                            java.lang.Object value)
Puts a JNDI property in the environment for the JNDI Initial Context used by this adaptor.
This method can be called only if this adaptor is not running.

Specified by:
putJNDIProperty in interface RMIAdaptorMBean
See Also:
clearJNDIProperties()

putNamingProperty

public void putNamingProperty(java.lang.Object property,
                              java.lang.Object value)
Deprecated. Replaced by {link #putJNDIProperty}

Specified by:
putNamingProperty in interface RMIAdaptorMBean

clearJNDIProperties

public void clearJNDIProperties()
Resets the JNDI properties set for this adaptor.
This method can be called only if this adaptor is not running.

Specified by:
clearJNDIProperties in interface RMIAdaptorMBean
See Also:
putJNDIProperty(java.lang.Object, java.lang.Object)

clearNamingProperties

public void clearNamingProperties()
Deprecated. Replaced by clearJNDIProperties()

Specified by:
clearNamingProperties in interface RMIAdaptorMBean

getJNDIProperties

public java.util.Properties getJNDIProperties()
Returns the JNDI properties for this adaptor.

Specified by:
getJNDIProperties in interface RMIAdaptorMBean
See Also:
putJNDIProperty(java.lang.Object, java.lang.Object)

getNamingProperties

public java.util.Properties getNamingProperties()
Deprecated. Replaced by getJNDIProperties()

Specified by:
getNamingProperties in interface RMIAdaptorMBean

getHostName

public java.lang.String getHostName()
Returns the host name on which this adaptor is running

Specified by:
getHostName in interface RMIAdaptorMBean

getHostAddress

public java.lang.String getHostAddress()
Returns the host address on which this adaptor is running

Specified by:
getHostAddress in interface RMIAdaptorMBean

invoke

public InvocationResult invoke(Invocation invocation)
                        throws java.lang.Exception
Description copied from interface: Invocable
Invocation method

Specified by:
invoke in interface Invocable
java.lang.Exception

addInterceptor

public void addInterceptor(Interceptor interceptor)
Adds an interceptor to this RMI adaptor


installInterceptors

protected void installInterceptors()

uninstallInterceptors

protected void uninstallInterceptors()

setMBeanServer

public void setMBeanServer(MBeanServer server)
Sets the target MBeanServer in case this adaptor is not registered with it


getMBeanServer

protected MBeanServer getMBeanServer()

getObjectName

protected ObjectName getObjectName()

bind

protected void bind(java.lang.Object adaptor)
             throws javax.naming.NamingException
javax.naming.NamingException

unbind

protected void unbind()
               throws javax.naming.NamingException
javax.naming.NamingException


Copyright © 2001-2002 MX4J Team. All Rights Reserved.