com.sun.jdmk.comm
Class RmiConnectorServer

java.lang.Object
  extended by com.sun.jdmk.comm.CommunicatorServer
      extended by com.sun.jdmk.comm.RmiConnectorServer
All Implemented Interfaces:
CommunicatorServerMBean, RmiConnectorServerMBean, Runnable, MBeanRegistration, NotificationBroadcaster

Deprecated. The JMX Remote API should be used in preference to the legacy Java DMK connector classes. The legacy RMI connector, including this class, may be removed in a future version of Java DMK. See javax.management.remote.rmi and JdmkLegacyConnector.

public class RmiConnectorServer
extends CommunicatorServer
implements MBeanRegistration, RmiConnectorServerMBean

Provides an implementation of the RmiConnectorServerMBean interface.

When creating the RmiConnectorServer , it is possible to specify the port number and service name to be used. To do so, you can use the appropriate constructor or use to corresponding setter. The default service name is specified by the constant com.sun.jdmk.ServiceName.RMI_CONNECTOR_SERVER. If you don't specify an object name when you register the RmiConnectorServer within the MBeanServer, the default one is: com.sun.jdmk.ServiceName.DOMAIN + ":" + com.sun.jdmk.ServiceName.RMI_CONNECTOR_SERVER


Field Summary
 
Fields inherited from class com.sun.jdmk.comm.CommunicatorServer
HTML_TYPE, HTTP_TYPE, HTTPS_TYPE, OFFLINE, ONLINE, RMI_TYPE, SNMP_TYPE, STARTING, STOPPING
 
Constructor Summary
RmiConnectorServer()
          Deprecated. Default constructor for RmiConnectorServer.
RmiConnectorServer(int port)
          Deprecated. Constructor for RmiConnectorServer.
RmiConnectorServer(int port, String serviceName)
          Deprecated. Constructor for RmiConnectorServer.
RmiConnectorServer(String serviceName)
          Deprecated. Constructor for RmiConnectorServer.
 
Method Summary
protected  void doBind()
          Deprecated. Binds the adaptor server.
protected  void doError(Exception e)
          Deprecated.  
protected  void doProcess()
          Deprecated. Returns immediately.
protected  void doReceive()
          Deprecated. Collects incoming requests.
protected  void doUnbind()
          Deprecated. Unbinds the adaptor.
 String getProtocol()
          Deprecated. Returns the name of the protocol (rmi).
 String getServiceName()
          Deprecated. Returns the service name of this RMI object.
protected  String makeDebugTag()
          Deprecated. Returns the string used in logging.
 void postDeregister()
          Deprecated. Allows the MBean to perform any operations needed after having been de-registered in the MBeanServer.
 void postRegister(Boolean registrationDone)
          Deprecated. Allows the MBean to perform any operations needed after having been registered in the MBeanServer or after the registration has failed.
 void preDeregister()
          Deprecated. Allows the MBean to perform any operations needed before being de-registered by the MBeanServer.
 ObjectName preRegister(MBeanServer server, ObjectName name)
          Deprecated. Allows the MBean to perform any operations it needs before being registered in the MBean server.
 void setMBeanServer(MBeanServer newMBS)
          Deprecated. Set the MBeanServer object to which incoming requests are sent.
 void setServiceName(String serviceName)
          Deprecated. Set the service name of this RMI object.
 void stop()
          Deprecated. Stops this connector server.
 
Methods inherited from class com.sun.jdmk.comm.CommunicatorServer
addNotificationListener, getHost, getMBeanServer, getNotificationInfo, getPort, getState, getStateString, isActive, removeNotificationListener, run, setPort, start, waitState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.jdmk.comm.CommunicatorServerMBean
getHost, getPort, getState, getStateString, isActive, setPort, start, waitState
 

Constructor Detail

RmiConnectorServer

public RmiConnectorServer()
Deprecated. 
Default constructor for RmiConnectorServer. com.sun.jdmk.ServiceName.RMI_CONNECTOR_PORT is used as default port number and the local host as host name. com.sun.jdmk.ServiceName.RMI_CONNECTOR_SERVER is used as default port service name.


RmiConnectorServer

public RmiConnectorServer(int port)
Deprecated. 
Constructor for RmiConnectorServer. com.sun.jdmk.ServiceName.RMI_CONNECTOR_SERVER is used as default port service name.


RmiConnectorServer

public RmiConnectorServer(String serviceName)
Deprecated. 
Constructor for RmiConnectorServer. com.sun.jdmk.ServiceName.RMI_CONNECTOR_PORT is used as default port number and the local host as host name.


RmiConnectorServer

public RmiConnectorServer(int port,
                          String serviceName)
Deprecated. 
Constructor for RmiConnectorServer.

Method Detail

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws Exception
Deprecated. 
Allows the MBean to perform any operations it needs before being registered in the MBean server. If the name of the RMI connector server MBean is not specified, it is initialized with the default value: com.sun.jdmk.ServiceName.DOMAIN: com.sun.jdmk.ServiceName.RMI_CONNECTOR_SERVER. If any exception is raised, the RMI connector server MBean will not be registered in the MBean server.

Specified by:
preRegister in interface MBeanRegistration
Overrides:
preRegister in class CommunicatorServer
Parameters:
server - The MBeanServer in which the MBean will be registered.
name - The object name of the MBean.
Returns:
The name of the registered MBean.
Throws:
Exception - This exception should be caught by the MBeanServer and re-thrown as an MBeanRegistrationException.

postRegister

public void postRegister(Boolean registrationDone)
Deprecated. 
Allows the MBean to perform any operations needed after having been registered in the MBeanServer or after the registration has failed.

Specified by:
postRegister in interface MBeanRegistration
Overrides:
postRegister in class CommunicatorServer
Parameters:
registrationDone - Indicates whether or not the MBean has been successfully registered in the MBeanServer. The value false means that the registration phase has failed.

preDeregister

public void preDeregister()
                   throws Exception
Deprecated. 
Allows the MBean to perform any operations needed before being de-registered by the MBeanServer.

Specified by:
preDeregister in interface MBeanRegistration
Overrides:
preDeregister in class CommunicatorServer
Throws:
Exception - This exception should be caught by the MBeanServer and re-thrown as an MBeanRegistrationException.

postDeregister

public void postDeregister()
Deprecated. 
Allows the MBean to perform any operations needed after having been de-registered in the MBeanServer.

Specified by:
postDeregister in interface MBeanRegistration
Overrides:
postDeregister in class CommunicatorServer

getServiceName

public String getServiceName()
Deprecated. 
Returns the service name of this RMI object.

Specified by:
getServiceName in interface RmiConnectorServerMBean
Returns:
The service name of this RMI connector.

setServiceName

public void setServiceName(String serviceName)
                    throws IllegalStateException
Deprecated. 
Set the service name of this RMI object.

Specified by:
setServiceName in interface RmiConnectorServerMBean
Parameters:
serviceName - The service name of this RMI connector.
Throws:
IllegalStateException - This method has been invoked while the RMI connector was ONLINE or STARTING.

getProtocol

public String getProtocol()
Deprecated. 
Returns the name of the protocol (rmi).

Specified by:
getProtocol in interface CommunicatorServerMBean
Specified by:
getProtocol in class CommunicatorServer
Returns:
The protocol as a string.

stop

public void stop()
Deprecated. 
Stops this connector server.

Has no effect if this RMI connector server is OFFLINE or STOPPING.

Specified by:
stop in interface CommunicatorServerMBean
Overrides:
stop in class CommunicatorServer

setMBeanServer

public void setMBeanServer(MBeanServer newMBS)
                    throws IllegalArgumentException,
                           IllegalStateException
Deprecated. 
Description copied from class: CommunicatorServer
Set the MBeanServer object to which incoming requests are sent. This must be either the MBean server in which this connector is registered, or an MBeanServerForwarder leading to that server. An MBeanServerForwarder mbsf leads to an MBean server mbs if mbsf.getMBeanServer() is either mbs or an MBeanServerForwarder leading to mbs.

Overrides:
setMBeanServer in class CommunicatorServer
Throws:
IllegalArgumentException - if newMBS is neither the MBean server in which this connector is registered nor an MBeanServerForwarder leading to that server.
IllegalStateException - This method has been invoked while the communicator was ONLINE or STARTING.

doError

protected void doError(Exception e)
                throws CommunicationException
Deprecated. 
Specified by:
doError in class CommunicatorServer
Throws:
CommunicationException

doBind

protected void doBind()
               throws CommunicationException,
                      InterruptedException
Deprecated. 
Binds the adaptor server.

Specified by:
doBind in class CommunicatorServer
Throws:
CommunicationException - if the adaptor can't bind to the specified port.
InterruptedException - when the adaptor is stopped.

doReceive

protected void doReceive()
                  throws CommunicationException,
                         InterruptedException
Deprecated. 
Collects incoming requests.

Specified by:
doReceive in class CommunicatorServer
Throws:
CommunicationException - if the adaptor is not bound to the specified port.
InterruptedException - when the adaptor is stopped.

doProcess

protected void doProcess()
                  throws CommunicationException,
                         InterruptedException
Deprecated. 
Returns immediately.

Specified by:
doProcess in class CommunicatorServer
Throws:
CommunicationException
InterruptedException

doUnbind

protected void doUnbind()
                 throws CommunicationException,
                        InterruptedException
Deprecated. 
Unbinds the adaptor.

Specified by:
doUnbind in class CommunicatorServer
Throws:
CommunicationException
InterruptedException

makeDebugTag

protected String makeDebugTag()
Deprecated. 
Description copied from class: CommunicatorServer
Returns the string used in logging.


Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.