org.objectweb.jonas.jmx
Class JonasManagementRepr

java.lang.Object
  extended byorg.objectweb.jonas.jmx.JonasManagementRepr

public class JonasManagementRepr
extends java.lang.Object

Wraper class. Apply the management operations on the ManagementRep instance.

Author:
Adriana Danes

Constructor Summary
JonasManagementRepr()
           
 
Method Summary
static java.lang.Object getAttribute(javax.management.ObjectName on, java.lang.String attribute)
           
static javax.management.AttributeList getAttributes(javax.management.ObjectName on, java.lang.String[] attributes)
           
static javax.naming.Context getContext()
           
static java.lang.String getCurrentRMIConnectorName()
           
static java.lang.String getJonasNamingServiceURL()
           
static javax.management.MBeanInfo getMBeanInfo(javax.management.ObjectName name)
           
static ManagementRepr getRepr()
           
static java.util.Set getRMIConnectorsNames()
           
static java.lang.Object invoke(javax.management.ObjectName on, java.lang.String operation, java.lang.Object[] param, java.lang.String[] signature)
           
static boolean isRegistered(javax.management.ObjectName on)
           
static java.util.Set queryNames(javax.management.ObjectName on)
           
static boolean reprNull()
          Test if repr null.
static void resetCurrentRMIConnectorName()
          Set the currentRMIConnectorName to null
static void setAttribute(javax.management.ObjectName on, java.lang.String attribute, java.lang.Object value)
           
static void setCurrentRMIConnectorName(java.lang.String name)
          Set the currentRMIConnectorName to the specified value
static void setJonasNamingServiceURL(java.lang.String url)
          Sets the PROVIDER_URL property to the specified value.
static void setNamingEnvCtx(java.util.Properties env)
          Create a new naming context based on the given env.
static void setRepr(ManagementRepr repr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JonasManagementRepr

public JonasManagementRepr()
Method Detail

reprNull

public static boolean reprNull()
Test if repr null. This means that the ManagementRepFactory did not managed to instantiate the ManagementRep class.

Returns:
true if ManagementRep not null

isRegistered

public static boolean isRegistered(javax.management.ObjectName on)
Parameters:
on - ObjectName of the MBean we are looking for
Returns:
True if the MBean is already registered in the MBean server, false otherwise or if an exception is catched.

getAttribute

public static java.lang.Object getAttribute(javax.management.ObjectName on,
                                            java.lang.String attribute)
                                     throws ManagementException
Parameters:
on - The ObjectName of the MBean from which the attribute is to be retrieved.
attribute - A String specifying the name of the attribute to be retrieve.
Returns:
The value of the attribute.
Throws:
ManagementException

getAttributes

public static javax.management.AttributeList getAttributes(javax.management.ObjectName on,
                                                           java.lang.String[] attributes)
                                                    throws ManagementException
Parameters:
on - The ObjectName of the MBean from which the attributes are to be retrieved.
attributes - A String array specifying the names of the attributes to be retrieved.
Returns:
The value of the attributes.
Throws:
ManagementException

setAttribute

public static void setAttribute(javax.management.ObjectName on,
                                java.lang.String attribute,
                                java.lang.Object value)
                         throws ManagementException
Parameters:
on - The ObjectName of the MBean within which the attribute is to be set.
attribute - A String specifying the name of the attribute to be retrieve.
value - The value to set to the attribute.
Throws:
ManagementException

invoke

public static java.lang.Object invoke(javax.management.ObjectName on,
                                      java.lang.String operation,
                                      java.lang.Object[] param,
                                      java.lang.String[] signature)
                               throws ManagementException
Parameters:
on -
Throws:
ManagementException

queryNames

public static java.util.Set queryNames(javax.management.ObjectName on)
                                throws ManagementException
Returns:
A set containing the ObjectNames for the MBeans selected.
Throws:
ManagementException

getMBeanInfo

public static javax.management.MBeanInfo getMBeanInfo(javax.management.ObjectName name)
                                               throws ManagementException
Returns:
An instance of MBeanInfo allowing the retrieval of all attributes and operations of this MBean.
Throws:
ManagementException

getContext

public static javax.naming.Context getContext()
                                       throws javax.naming.NamingException
Returns:
Context the current application context.
Throws:
javax.naming.NamingException

getCurrentRMIConnectorName

public static java.lang.String getCurrentRMIConnectorName()
Returns:
String the name of the current RMI connector. Return null if no RMI connector is available.

setCurrentRMIConnectorName

public static void setCurrentRMIConnectorName(java.lang.String name)
                                       throws java.lang.Exception
Set the currentRMIConnectorName to the specified value

Throws:
java.lang.Exception

resetCurrentRMIConnectorName

public static void resetCurrentRMIConnectorName()
Set the currentRMIConnectorName to null


getRMIConnectorsNames

public static java.util.Set getRMIConnectorsNames()
                                           throws javax.naming.NamingException
Returns:
Set a set containning all RMI connector names available in the current context.
Throws:
javax.naming.NamingException

getJonasNamingServiceURL

public static java.lang.String getJonasNamingServiceURL()
Returns:
String the value of the PROVIDER_URL property in the current context.

setJonasNamingServiceURL

public static void setJonasNamingServiceURL(java.lang.String url)
                                     throws javax.naming.NamingException
Sets the PROVIDER_URL property to the specified value.

Throws:
javax.naming.NamingException

setNamingEnvCtx

public static void setNamingEnvCtx(java.util.Properties env)
                            throws javax.naming.NamingException
Create a new naming context based on the given env. properties

Parameters:
env - properties to create a new naming context
Throws:
javax.naming.NamingException

getRepr

public static ManagementRepr getRepr()
Returns:
Returns the repr.

setRepr

public static void setRepr(ManagementRepr repr)
Parameters:
repr - The repr to set.