mx4j.tools.adaptor.rmi
Class RMIAdaptor

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended bymx4j.tools.adaptor.rmi.RMIAdaptor
All Implemented Interfaces:
Invocable, javax.management.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, javax.management.MBeanRegistration, RemoteAdaptor

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

Version:
$Revision: 1.3 $
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  javax.management.MBeanServer getMBeanServer()
           
 java.util.Properties getNamingProperties()
          Deprecated. Replaced by getJNDIProperties()
protected  javax.management.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()
           
 void postRegister(java.lang.Boolean registrationDone)
           
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
           
 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(javax.management.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 javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws java.lang.Exception
Specified by:
preRegister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Specified by:
preDeregister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.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
Throws:
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
Throws:
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
Throws:
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(javax.management.MBeanServer server)
Sets the target MBeanServer in case this adaptor is not registered with it


getMBeanServer

protected javax.management.MBeanServer getMBeanServer()

getObjectName

protected javax.management.ObjectName getObjectName()

bind

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

unbind

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


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