com.sun.jdmk.comm
Interface RemoteMBeanServer

All Superinterfaces:
ClientNotificationHandler, NotificationRegistration, ProxyHandler
All Known Implementing Classes:
GenericHttpConnectorClient, HttpConnectorClient, HttpsConnectorClient, RmiConnectorClient

Deprecated. The JMX Remote API should be used in preference to the legacy Java DMK connector classes. This interface may be removed in a future version of Java DMK. See JdmkLegacyConnector.

public interface RemoteMBeanServer
extends ProxyHandler, ClientNotificationHandler

Defines the methods necessary for remote creation, access and deletion of MBeans. It creates local objects (ProxyMBeans and GenericProxies) to be used as "proxies" on the MBeans.


Field Summary
 
Fields inherited from interface com.sun.jdmk.comm.ClientNotificationHandler
DISCARD_NEW, DISCARD_OLD, NO_CACHE_LIMIT, PULL_MODE, PUSH_MODE
 
Method Summary
 String connect(ConnectorAddress MBeanServerAddress)
          Deprecated. Initializes the communication with the remote MBeanServer.
 ObjectInstance createMBean(String className, ObjectName name)
          Deprecated. Creates and registers an instance of an MBean in the remote object server.
 ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature)
          Deprecated. Creates and registers an instance of an MBean in the remote object server.
 ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName)
          Deprecated. Creates and registers an instance of an MBean in the remote object server.
 ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature)
          Deprecated. Creates and registers an instance of an MBean in the remote object server.
 void disconnect()
          Deprecated. Terminates the communication with the MBeanServer.
 Object getAttribute(ObjectName name, String attribute)
          Deprecated. Gets the value of a specific attribute of a named MBean.
 AttributeList getAttributes(ObjectName name, String[] attributes)
          Deprecated. Allows you to retrieve the values of several attributes of an MBean.
 String getClassForProxyMBean(ObjectInstance instance)
          Deprecated. Given the object name and the Java class name of the MBean(ObjectInstance), this method returns the name of the Java class of the corresponding ProxyMBean.
 String getDefaultDomain()
          Deprecated. Returns the default domain used for the MBean naming.
 Integer getMBeanCount()
          Deprecated. Returns the number of MBeans controlled by the MBeanServer.
 MBeanInfo getMBeanInfo(ObjectName name)
          Deprecated. This method supplies the exposed attributes and actions of the MBean.
 ConnectorAddress getMBeanServerAddress()
          Deprecated. Returns the exact address of the MBeanServer to which the ConnectorClient is connected.
 String getMBeanServerId()
          Deprecated. Returns a string which represents the MBeanServer identification.
 ObjectInstance getObjectInstance(ObjectName name)
          Deprecated. Gets the ObjectInstance for a given MBean registered with the MBeanServer.
 OperationContext getOperationContext()
          Deprecated. Get the OperationContext that was last given to setOperationContext, or null if setOperationContext was never called.
 Object invoke(ObjectName name, String operationName, Object[] params, String[] signature)
          Deprecated. Invokes a method of an MBean.
 boolean isConnected()
          Deprecated. Checks whether communication with the MBeanServer is established.
 boolean isInstanceOf(ObjectName name, String className)
          Deprecated. Returns true if the MBean specified is an instance of the specified class, false otherwise.
 boolean isRegistered(ObjectName name)
          Deprecated. Checks whether an MBean, identified by its object name, is already registered with the MBeanServer.
 Set queryMBeans(ObjectName name, QueryExp query)
          Deprecated. Gets MBeans controlled by the MBeanServer.
 Set queryNames(ObjectName name, QueryExp query)
          Deprecated. Gets the names of MBeans controlled by the MBeanServer.
 void setAttribute(ObjectName name, Attribute attribute)
          Deprecated. Sets the value of a specific attribute of a named MBean.
 AttributeList setAttributes(ObjectName name, AttributeList attributes)
          Deprecated. Allows you to modify the values of several attributes of an MBean.
 void setOperationContext(OperationContext c)
          Deprecated. Set the OperationContext of this connection.
 void unregisterMBean(ObjectName name)
          Deprecated. Deletes an instance of an MBean in the remote MBean server.
 
Methods inherited from interface com.sun.jdmk.NotificationRegistration
addNotificationListener, removeNotificationListener
 
Methods inherited from interface com.sun.jdmk.comm.ClientNotificationHandler
clearCache, getCacheSize, getMode, getNotifications, getOverflowCount, getOverflowMode, getPeriod, setCacheSize, setMode, setOverflowCount, setOverflowMode, setPeriod
 
Methods inherited from interface com.sun.jdmk.NotificationRegistration
addNotificationListener, removeNotificationListener
 

Method Detail

connect

String connect(ConnectorAddress MBeanServerAddress)
Deprecated. 
Initializes the communication with the remote MBeanServer. All the information needed for identifying the MBeanServer to contact and the protocol to be used is contained in the object of type ConnectorAddress, passed as a parameter. If a communication problem occurs this method will throw a CommunicationException (JMRuntimeException). If the RemoteMBeanServer had already been connected and disconnected with an MBeanServer identified by its MBeanServerId, and if the MBeanServer reachable by the MBeanServerAddress parameter doesn't have the same MBeanServerId, the java.lang.IllegalAccessException is thrown.

Parameters:
MBeanServerAddress - The exact MBeanServer address to contact (MBeanServer identification, protocol specification).
Returns:
A String identifying the MBeanServer with which the communication is established.
Throws:
IllegalArgumentException - The RemoteMBeanServer has already been connected and disconnected and the specified ConnectorAddress doesn't identify the same MBeanServer.

disconnect

void disconnect()
Deprecated. 
Terminates the communication with the MBeanServer.


isConnected

boolean isConnected()
Deprecated. 
Checks whether communication with the MBeanServer is established.

Returns:
True, if the communication is established, otherwise false.

getMBeanServerAddress

ConnectorAddress getMBeanServerAddress()
Deprecated. 
Returns the exact address of the MBeanServer to which the ConnectorClient is connected. The address is of type ConnectorAddress.

Returns:
The exact address of the remote MBeanServer, or null if the ConnectorClient is not connected.

setOperationContext

void setOperationContext(OperationContext c)
Deprecated. 

Set the OperationContext of this connection. This context will be sent along with each request and can be recovered by the server, which can make it available to the operations it invokes.

The saved OperationContext will be a clone of the object c made using its clone method.

Parameters:
c - the new OperationContext. It may be null to indicate that there is no context. The previous OperationContext, if any, is lost.

getOperationContext

OperationContext getOperationContext()
Deprecated. 
Get the OperationContext that was last given to setOperationContext, or null if setOperationContext was never called.

Returns:
the current OperationContext.

getMBeanServerId

String getMBeanServerId()
Deprecated. 
Returns a string which represents the MBeanServer identification. This String comes from the MBeanServerDelegate Mbean.

Returns:
If the Connector Client has not been connected yet, it returns null. If the connector Client has been connected and disconnected, getMbeanServerId still returns the previous MbeanServer identification.

createMBean

ObjectInstance createMBean(String className,
                           ObjectName name)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException
Deprecated. 
Creates and registers an instance of an MBean in the remote object server. When calling the method, you have to provide the class name of the Java implementation to be used for instantiating the new object. It returns an ObjectInstance representing the remote MBean created.

Parameters:
className - The name of the Java class to be used by the MBeanServer for creating the MBean.
name - The name of the MBean to be created.
Returns:
An ObjectInstance representing the newly created MBean.
Throws:
ReflectionException - Wraps the java.lang.Exception that occurred when trying to invoke the MBean's constructor.
InstanceAlreadyExistsException - The MBean is already under the control of the MBean server.
MBeanRegistrationException - The preRegister (MBeanRegistration interface) method of the MBean has thrown an exception. The MBean will not be registered.
MBeanException - Wraps an exception thrown by the MBean's constructor.
NotCompliantMBeanException - This class is not a JMX compliant MBean.

createMBean

ObjectInstance createMBean(String className,
                           ObjectName name,
                           ObjectName loaderName)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  InstanceNotFoundException
Deprecated. 
Creates and registers an instance of an MBean in the remote object server. When calling the method, you have to provide the class name of the Java implementation to be used for instantiating the new object. You can optionally provide the name of the class loader to be used. It returns an ObjectInstance representing the remote MBean created.

Parameters:
className - The name of the Java class to be used by the MBeanServer for creating the MBean.
name - The name of the MBean to be created.
loaderName - The name of the class loader to be used by the MBeanServer.
Returns:
An ObjectInstance representing the newly created MBean.
Throws:
ReflectionException - Wraps the java.lang.Exception that occurred trying to invoke the MBean's constructor.
InstanceAlreadyExistsException - The MBean is already under the control of the MBean server.
MBeanRegistrationException - The preRegister (MBeanRegistration interface) method of the MBean has thrown an exception. The MBean will not be registered.
MBeanException - Wraps an exception thrown by the MBean's constructor.
NotCompliantMBeanException - This class is not a JMX compliant MBean.
InstanceNotFoundException - The specified loader is not registered in the MBeanServer

createMBean

ObjectInstance createMBean(String className,
                           ObjectName name,
                           Object[] params,
                           String[] signature)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException
Deprecated. 
Creates and registers an instance of an MBean in the remote object server. When calling the method, you have to provide the class name of the Java implementation to be used for instantiating the new object. It returns an ObjectInstance representing the remote MBean created.

Parameters:
className - The name of the Java class to be used by the MBeanServer for creating the MBean.
name - The name of the MBean to be created.
params - An array containing the parameters of the constructor to be invoked. A parameter can be any Java object that is serializable.
signature - An array containing the signature of the constructor to be invoked.
Returns:
An ObjectInstance representing the newly created MBean.
Throws:
ReflectionException - Wraps the java.lang.Exception that occurred trying to invoke the MBean's constructor.
InstanceAlreadyExistsException - The MBean is already under the control of the MBean server.
MBeanRegistrationException - The preRegister (MBeanRegistration interface) method of the MBean has thrown an exception. The MBean will not be registered.
MBeanException - Wraps an exception thrown by the MBean's constructor.
NotCompliantMBeanException - This class is not a JMX compliant MBean.

createMBean

ObjectInstance createMBean(String className,
                           ObjectName name,
                           ObjectName loaderName,
                           Object[] params,
                           String[] signature)
                           throws ReflectionException,
                                  InstanceAlreadyExistsException,
                                  MBeanRegistrationException,
                                  MBeanException,
                                  NotCompliantMBeanException,
                                  InstanceNotFoundException
Deprecated. 
Creates and registers an instance of an MBean in the remote object server. When calling the method, you have to provide the class name of the Java implementation to be used for instantiating the new object. You can optionally provide the name of the class loader to be used. It returns an ObjectInstance representing the remote MBean created.

Parameters:
className - The name of the Java class to be used by the MBeanServer for creating the MBean.
name - The name of the MBean to be created.
loaderName - The name of the class loader to be used by the MBeanServer.
params - An array containing the parameters of the constructor to be invoked. A parameter can be any Java object that is serializable.
signature - An array containing the signature of the constructor to be invoked.
Returns:
An ObjectInstance representing the newly created MBean.
Throws:
ReflectionException - Wraps the java.lang.Exception that occurred trying to invoke the MBean's constructor.
InstanceAlreadyExistsException - The MBean is already under the control of the MBean server.
MBeanRegistrationException - The preRegister (MBeanRegistration interface) method of the MBean has thrown an exception. The MBean will not be registered.
MBeanException - Wraps an exception thrown by the MBean's constructor.
NotCompliantMBeanException - This class is not a JMX compliant MBean.
InstanceNotFoundException - The specified loader is not registered in the MBeanServer.

unregisterMBean

void unregisterMBean(ObjectName name)
                     throws InstanceNotFoundException,
                            MBeanRegistrationException
Deprecated. 
Deletes an instance of an MBean in the remote MBean server. It also removes its local proxy (ProxyMBean and/or GenericProxy) object from remote MBean server.

Specified by:
unregisterMBean in interface ProxyHandler
Parameters:
name - The name of the MBean to be deleted.
Throws:
InstanceNotFoundException - The specified MBean is not registered in the MBean server.
MBeanRegistrationException - The preDeregister (MBeanRegistration interface) method of the MBean has thrown an exception.

queryNames

Set queryNames(ObjectName name,
               QueryExp query)
Deprecated. 
Gets the names of MBeans controlled by the MBeanServer. This method allows any of the following to be obtained: The names of all MBeans, the names of a set of MBeans specified by pattern matching on the ObjectName and/or a Query expression, a specific MBean name (equivalent to testing whether an MBean is registered). When the object name is null or empty, all the objects are to be selected (and filtered if a query is specified). It returns the set of ObjectNames for the MBeans selected.

Parameters:
name - The object name pattern identifying the MBean names to be retrieved. If null or empty, the names of all the registered MBeans will be retrieved.
query - The query expression to be applied for selecting MBeans.
Returns:
A set containing the ObjectNames for the MBeans selected.

queryMBeans

Set queryMBeans(ObjectName name,
                QueryExp query)
Deprecated. 
Gets MBeans controlled by the MBeanServer. This method allows any of the following to be obtained: All MBeans, a set of MBeans specified by pattern matching on the ObjectName and/or a Query expression, a specific MBean. When the object name is null or empty, all objects are to be selected (and filtered if a query is specified). It returns the set of ObjectInstances for the selected MBeans.

Parameters:
name - The object name pattern identifying the MBeans to be retrieved. If null or empty all the MBeans registered will be retrieved.
query - The query expression to be applied for selecting MBeans.
Returns:
A set containing the ObjectInstances for the MBeans selected.

isRegistered

boolean isRegistered(ObjectName name)
Deprecated. 
Checks whether an MBean, identified by its object name, is already registered with the MBeanServer.

Parameters:
name - The object name of the MBean to be checked.
Returns:
True if the MBean is already registered in the MBeanServer, false otherwise.
Throws:
RuntimeOperationsException - Wraps an IllegalArgumentException: The object name in parameter is null.

getAttribute

Object getAttribute(ObjectName name,
                    String attribute)
                    throws MBeanException,
                           AttributeNotFoundException,
                           InstanceNotFoundException,
                           ReflectionException
Deprecated. 
Gets the value of a specific attribute of a named MBean. The MBean is identified by its object name.

Specified by:
getAttribute in interface ProxyHandler
Parameters:
name - The object name of the MBean from which the attribute is to be retrieved.
attribute - The name of the attribute to be retrieved.
Returns:
The value of the retrieved attribute. The return value can be any Java object that is serializable.
Throws:
AttributeNotFoundException - The specified attribute is not accessible in the MBean.
MBeanException - Wraps an exception thrown by the MBean's getter.
InstanceNotFoundException - The specified MBean is not registered in the MBean server.
ReflectionException - Wraps an exception thrown while trying to instantiate and apply the operator specified in Modification.

getAttributes

AttributeList getAttributes(ObjectName name,
                            String[] attributes)
                            throws InstanceNotFoundException,
                                   ReflectionException
Deprecated. 
Allows you to retrieve the values of several attributes of an MBean.

Specified by:
getAttributes in interface ProxyHandler
Parameters:
name - The object name of the MBean from within which the attributes are to be retrieved.
attributes - A list of the attributes to be retrieved.
Returns:
The values of the attributes retrieved. The value of the attributes can be any Java object that is serializable.
Throws:
InstanceNotFoundException - The specified MBean is not registered in the MBean server.
ReflectionException - An exception occurred trying to invoke the getAttributes of a Dynamic MBean.

setAttribute

void setAttribute(ObjectName name,
                  Attribute attribute)
                  throws InstanceNotFoundException,
                         AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException
Deprecated. 
Sets the value of a specific attribute of a named MBean. The MBean is identified by its object name.

Specified by:
setAttribute in interface ProxyHandler
Parameters:
name - The name of the MBean within which the attribute is to be set.
attribute - The modification to be performed: The identification of the attribute to be set, the value it is to be set to, and the operator to apply. The value of the attribute can be any Java object that is serializable.
Throws:
InstanceNotFoundException - The specified MBean is not registered in the MBean server.
AttributeNotFoundException - The specified attribute is not accessible in the MBean.
InvalidAttributeValueException - The specified value for the attribute is not valid.
MBeanException - Wraps an exception thrown by the MBean's setter.
ReflectionException - Wraps an exception thrown while trying to instantiate and apply the operator specified in Modification.

setAttributes

AttributeList setAttributes(ObjectName name,
                            AttributeList attributes)
                            throws InstanceNotFoundException,
                                   ReflectionException
Deprecated. 
Allows you to modify the values of several attributes of an MBean.

Specified by:
setAttributes in interface ProxyHandler
Parameters:
name - The object name of the MBean from within which the attributes are to be set.
attributes - A list of the attributes to be set, their values and, optionally, the operators to apply. The value of the attributes can be any Java object that is serializable.
Returns:
The values of the attributes that were set. The value of the attributes can be any Java object that is serializable.
Throws:
InstanceNotFoundException - The specified MBean is not registered in the MBean server.
ReflectionException - An exception occurred trying to invoke the setAttributes of a Dynamic MBean.

invoke

Object invoke(ObjectName name,
              String operationName,
              Object[] params,
              String[] signature)
              throws InstanceNotFoundException,
                     MBeanException,
                     ReflectionException
Deprecated. 
Invokes a method of an MBean.

Specified by:
invoke in interface ProxyHandler
Parameters:
name - The name of the MBean on which the method is to be invoked.
operationName - The name of the operation to be invoked.
params - An array containing the parameters to be set when the operation is invoked. A parameter can be any Java object that is serializable.
signature - An array containing the signature of the method.
Returns:
The object returned by the invocation of the given method. The return value can be any Java object that is serializable.
Throws:
InstanceNotFoundException - The specified MBean is not registered in the MBean server.
MBeanException - Wraps an exception thrown by the MBean's invoked method.
ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the method.

getMBeanInfo

MBeanInfo getMBeanInfo(ObjectName name)
                       throws InstanceNotFoundException,
                              IntrospectionException,
                              ReflectionException
Deprecated. 
This method supplies the exposed attributes and actions of the MBean. It provides this information using an MBeanInfo object.

Specified by:
getMBeanInfo in interface ProxyHandler
Parameters:
name - The name of the MBean whose attributes and actions will be returned.
Returns:
An instance of MBeanInfo which allows all methods and actions of this MBean to be retrieved.
Throws:
InstanceNotFoundException - The specified MBean is not registered in the MBean server.
IntrospectionException - An exception occurs during introspection.
ReflectionException - Wraps a java.lang.Exception thrown while trying to invoke the getMBeanInfo method.

getObjectInstance

ObjectInstance getObjectInstance(ObjectName name)
                                 throws InstanceNotFoundException
Deprecated. 
Gets the ObjectInstance for a given MBean registered with the MBeanServer.

Parameters:
name - The object name of the MBean.
Returns:
The ObjectInstance associated to the MBean specified by name.
Throws:
InstanceNotFoundException - The specified MBean is not registered in the MBeanServer.

getMBeanCount

Integer getMBeanCount()
Deprecated. 
Returns the number of MBeans controlled by the MBeanServer.


getDefaultDomain

String getDefaultDomain()
Deprecated. 
Returns the default domain used for the MBean naming.


isInstanceOf

boolean isInstanceOf(ObjectName name,
                     String className)
                     throws InstanceNotFoundException
Deprecated. 
Returns true if the MBean specified is an instance of the specified class, false otherwise.

Parameters:
name - The ObjectName of the MBean.
className - The name of the class.
Returns:
true if the MBean specified is an instance of the specified class, false otherwise.
Throws:
InstanceNotFoundException - The MBean specified is not registered in the MBean server.

getClassForProxyMBean

String getClassForProxyMBean(ObjectInstance instance)
                             throws ProxyMBeanInstantiationException
Deprecated. 
Given the object name and the Java class name of the MBean(ObjectInstance), this method returns the name of the Java class of the corresponding ProxyMBean. The returned name can be null, if there is no Java class corresponding to the ProxyMBean needed.

Parameters:
instance - The ObjectInstance of the MBean which is represented by the ProxyMBean.
Returns:
The name of the Java class of the ProxyMBean.
Throws:
ProxyMBeanInstantiationException

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.