com.tivoli.jmx.connector.rmi
Class MBeanServerConnectionImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--com.tivoli.jmx.connector.rmi.MBeanServerConnectionImpl

public class MBeanServerConnectionImpl
extends java.rmi.server.UnicastRemoteObject
implements MBeanServerConnection

MBeanServerConnectionImpl.java

Version:
1.2
Author:
Ward Harold
See Also:
Serialized Form

Field Summary
static java.lang.String CONNECTION_NAME
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
  MBeanServerConnectionImpl()
          Create a new instance of an MBeanServerConnection.
protected MBeanServerConnectionImpl(int port)
          Create a new instance of an MBeanServerConnection.
protected MBeanServerConnectionImpl(int port, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf)
          Create a new instance of an MBeanServerConnection.
 
Method Summary
 com.tivoli.jmx.connector.rmi.ObjectInstance createMBean(java.lang.String className, javax.management.ObjectName name)
          Instantiates and registers an MBean in the MBean server.
 java.lang.Object getAttribute(javax.management.ObjectName name, java.lang.String attribute)
          Gets the value of a specific attribute of a named MBean.
 com.tivoli.jmx.connector.rmi.AttributeList getAttributes(javax.management.ObjectName name, java.lang.String[] attributes)
          Enables the values of several attributes of a named MBean.
 java.lang.String getDefaultDomain()
          Returns the default domain used for naming the MBean.
 java.lang.Integer getMBeanCount()
          Returns the number of MBeans registered in the MBean server.
 com.tivoli.jmx.connector.rmi.MBeanInfo getMBeanInfo(javax.management.ObjectName name)
          This method discovers the attributes and operations that an MBean exposes for management.
 com.tivoli.jmx.connector.rmi.ObjectInstance getObjectInstance(javax.management.ObjectName name)
          Gets the ObjectInstance for a given MBean registered with the MBean server.
 java.lang.Object invoke(javax.management.ObjectName name, java.lang.String operationName, java.lang.Object[] invocationParams, java.lang.String[] signature)
          Invokes an operation on an MBean.
 boolean isInstanceOf(javax.management.ObjectName name, java.lang.String className)
          Returns true if the MBean specified is an instance of the specified class, false otherwise.
 boolean isRegistered(javax.management.ObjectName name)
          Checks whether an MBean, identified by its object name, is already registered with the MBean server.
 java.util.Set queryMBeans(javax.management.ObjectName name, javax.management.QueryExp query)
          Gets MBeans controlled by the MBean server.
 java.util.Set queryNames(javax.management.ObjectName name, javax.management.QueryExp query)
          Gets the names of MBeans controlled by the MBean server.
 void setAttribute(javax.management.ObjectName name, com.tivoli.jmx.connector.rmi.Attribute attribute)
          Sets the value of a specific attribute of a named MBean.
 com.tivoli.jmx.connector.rmi.AttributeList setAttributes(javax.management.ObjectName name, com.tivoli.jmx.connector.rmi.AttributeList attributes)
          Sets the values of several attributes of a named MBean.
 void setMBeanServer(javax.management.MBeanServer server)
          Links the connection to an MBeanServer instance.
 void unregisterMBean(javax.management.ObjectName name)
          De-registers an MBean from the MBean server.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
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
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CONNECTION_NAME

public static final java.lang.String CONNECTION_NAME
Constructor Detail

MBeanServerConnectionImpl

public MBeanServerConnectionImpl()
                          throws java.rmi.RemoteException
Create a new instance of an MBeanServerConnection. This connection delegates client requests to an MBeanServer.
Throws:
java.rmi.RemoteException - The exception description.

MBeanServerConnectionImpl

protected MBeanServerConnectionImpl(int port)
                             throws java.rmi.RemoteException
Create a new instance of an MBeanServerConnection. This connection delegates client requests to an MBeanServer.
Parameters:
port - int
Throws:
java.rmi.RemoteException - The exception description.

MBeanServerConnectionImpl

protected MBeanServerConnectionImpl(int port,
                                    java.rmi.server.RMIClientSocketFactory csf,
                                    java.rmi.server.RMIServerSocketFactory ssf)
                             throws java.rmi.RemoteException
Create a new instance of an MBeanServerConnection. This connection delegates client requests to an MBeanServer.
Parameters:
port - int
csf - java.rmi.server.RMIClientSocketFactory
ssf - java.rmi.server.RMIServerSocketFactory
Throws:
java.rmi.RemoteException - The exception description.
Method Detail

createMBean

public com.tivoli.jmx.connector.rmi.ObjectInstance createMBean(java.lang.String className,
                                                               javax.management.ObjectName name)
                                                        throws java.rmi.RemoteException
Instantiates and registers an MBean in the MBean server.
Specified by:
createMBean in interface MBeanServerConnection
Tags copied from interface: MBeanServerConnection
Parameters:
className - java.lang.String
name - javax.management.ObjectName
Returns:
javax.management.ObjectInstance

getAttribute

public java.lang.Object getAttribute(javax.management.ObjectName name,
                                     java.lang.String attribute)
                              throws java.rmi.RemoteException
Gets the value of a specific attribute of a named MBean. The MBean is identified by its object name.
Specified by:
getAttribute in interface MBeanServerConnection
Tags copied from interface: MBeanServerConnection
Parameters:
name - javax.management.ObjectName
attribute - java.lang.String
Returns:
java.lang.Object

getAttributes

public com.tivoli.jmx.connector.rmi.AttributeList getAttributes(javax.management.ObjectName name,
                                                                java.lang.String[] attributes)
                                                         throws java.rmi.RemoteException
Enables the values of several attributes of a named MBean. The MBean is identified by its object name.
Specified by:
getAttributes in interface MBeanServerConnection
Tags copied from interface: MBeanServerConnection
Parameters:
name - javax.management.ObjectName
attributes - java.lang.String[]
Returns:
javax.management.AttributeList

getDefaultDomain

public java.lang.String getDefaultDomain()
                                  throws java.rmi.RemoteException
Returns the default domain used for naming the MBean. The default domain name is used as the domain part in the ObjectName of MBeans if no domain is specified by the user
Specified by:
getDefaultDomain in interface MBeanServerConnection
Tags copied from interface: MBeanServerConnection
Returns:
java.lang.String

getMBeanCount

public java.lang.Integer getMBeanCount()
                                throws java.rmi.RemoteException
Returns the number of MBeans registered in the MBean server.
Specified by:
getMBeanCount in interface MBeanServerConnection
Tags copied from interface: MBeanServerConnection
Returns:
java.lang.Integer

getMBeanInfo

public com.tivoli.jmx.connector.rmi.MBeanInfo getMBeanInfo(javax.management.ObjectName name)
                                                    throws java.rmi.RemoteException
This method discovers the attributes and operations that an MBean exposes for management.
Specified by:
getMBeanInfo in interface MBeanServerConnection
Tags copied from interface: MBeanServerConnection
Parameters:
name - javax.management.ObjectName
Returns:
javax.management.MBeanInfo

getObjectInstance

public com.tivoli.jmx.connector.rmi.ObjectInstance getObjectInstance(javax.management.ObjectName name)
                                                              throws java.rmi.RemoteException
Gets the ObjectInstance for a given MBean registered with the MBean server.
Specified by:
getObjectInstance in interface MBeanServerConnection
Tags copied from interface: MBeanServerConnection
Parameters:
name - javax.management.ObjectName
Returns:
javax.management.ObjectInstance

invoke

public java.lang.Object invoke(javax.management.ObjectName name,
                               java.lang.String operationName,
                               java.lang.Object[] invocationParams,
                               java.lang.String[] signature)
                        throws java.rmi.RemoteException
Invokes an operation on an MBean.
Specified by:
invoke in interface MBeanServerConnection
Tags copied from interface: MBeanServerConnection
Parameters:
name - javax.management.ObjectName
operationName - java.lang.String
params - java.lang.Object[]
signature - java.lang.String[]
Returns:
java.lang.Object

isInstanceOf

public boolean isInstanceOf(javax.management.ObjectName name,
                            java.lang.String className)
                     throws java.rmi.RemoteException
Returns true if the MBean specified is an instance of the specified class, false otherwise.
Specified by:
isInstanceOf in interface MBeanServerConnection
Tags copied from interface: MBeanServerConnection
Parameters:
name - javax.management.ObjectName
className - java.lang.String
Returns:
boolean

isRegistered

public boolean isRegistered(javax.management.ObjectName name)
                     throws java.rmi.RemoteException
Checks whether an MBean, identified by its object name, is already registered with the MBean server.
Specified by:
isRegistered in interface MBeanServerConnection
Tags copied from interface: MBeanServerConnection
Parameters:
name - javax.management.ObjectName
Returns:
boolean

queryMBeans

public java.util.Set queryMBeans(javax.management.ObjectName name,
                                 javax.management.QueryExp query)
                          throws java.rmi.RemoteException
Gets MBeans controlled by the MBean server. 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 no domain and key properties are specified, all objects are to be selected (and filtered if a query is specified). It returns the set of ObjectInstance objects (containing the ObjectName and the Java Class name) for the selected MBeans.
Specified by:
queryMBeans in interface MBeanServerConnection
Tags copied from interface: MBeanServerConnection
Parameters:
name - javax.management.ObjectName
query - javax.management.QueryExp
Returns:
java.util.Set

queryNames

public java.util.Set queryNames(javax.management.ObjectName name,
                                javax.management.QueryExp query)
                         throws java.rmi.RemoteException
Gets the names of MBeans controlled by the MBean server. This method enables 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 no domain and key properties are specified, all objects are selected (and filtered if a query is specified). It returns the set of ObjectNames for the MBeans selected.
Specified by:
queryNames in interface MBeanServerConnection
Tags copied from interface: MBeanServerConnection
Parameters:
name - javax.management.ObjectName
query - javax.management.QueryExp
Returns:
java.util.Set

setAttribute

public void setAttribute(javax.management.ObjectName name,
                         com.tivoli.jmx.connector.rmi.Attribute attribute)
                  throws java.rmi.RemoteException
Sets the value of a specific attribute of a named MBean. The MBean is identified by its object name.

setAttributes

public com.tivoli.jmx.connector.rmi.AttributeList setAttributes(javax.management.ObjectName name,
                                                                com.tivoli.jmx.connector.rmi.AttributeList attributes)
                                                         throws java.rmi.RemoteException
Sets the values of several attributes of a named MBean. The MBean is identified by its object name

setMBeanServer

public void setMBeanServer(javax.management.MBeanServer server)
Links the connection to an MBeanServer instance.
Parameters:
server - javax.management.MBeanServer

unregisterMBean

public void unregisterMBean(javax.management.ObjectName name)
                     throws java.rmi.RemoteException
De-registers an MBean from the MBean server. The MBean is identified by its object name. Once the method has been invoked, the MBean may no longer be accessed by its object name.
Specified by:
unregisterMBean in interface MBeanServerConnection
Tags copied from interface: MBeanServerConnection
Parameters:
name - javax.management.ObjectName