org.objectweb.jonas.jmx
Class ManagementReprImpl

java.lang.Object
  extended by org.objectweb.jonas.jmx.ManagementReprImpl
All Implemented Interfaces:
ManagementRepr

public class ManagementReprImpl
extends java.lang.Object
implements ManagementRepr

Provides a management representative to be used by JMX based management applications.

Author:
Adriana Danes

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

Constructor Detail

ManagementReprImpl

protected ManagementReprImpl()
Method Detail

isRegistered

public boolean isRegistered(javax.management.ObjectName on)
Specified by:
isRegistered in interface ManagementRepr
Returns:
True if the MBean is already registered in the MBean server, false otherwise or if an exception is catched.

getAttribute

public java.lang.Object getAttribute(javax.management.ObjectName on,
                                     java.lang.String attribute)
                              throws ManagementException
Specified by:
getAttribute in interface ManagementRepr
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 javax.management.AttributeList getAttributes(javax.management.ObjectName on,
                                                    java.lang.String[] attributes)
                                             throws ManagementException
Specified by:
getAttributes in interface ManagementRepr
Parameters:
on - The ObjectName of the MBean of which attribute are to be retrieved.
attributes - A list of the attributes to be retrieved.
Returns:
Thelist of retrieved attributes.
Throws:
ManagementException

setAttribute

public void setAttribute(javax.management.ObjectName on,
                         java.lang.String attribute,
                         java.lang.Object value)
                  throws ManagementException
Specified by:
setAttribute in interface ManagementRepr
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

setAttributes

public javax.management.AttributeList setAttributes(javax.management.ObjectName on,
                                                    javax.management.AttributeList attributes)
                                             throws ManagementException
Specified by:
setAttributes in interface ManagementRepr
Parameters:
on - The ObjectName of the MBean of which the attribute is to be set.
attributes - A list of attributes: The identification of the attribute to be set and the value it is to be set to
Returns:
The list of attributes that were set, with their new values.
Throws:
ManagementException

invoke

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

queryNames

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

getMBeanInfo

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

getContext

public javax.naming.Context getContext()
                                throws javax.naming.NamingException
Specified by:
getContext in interface ManagementRepr
Returns:
Context the current application context, create an initial context if there is no current context.
Throws:
javax.naming.NamingException

getCurrentRMIConnectorName

public java.lang.String getCurrentRMIConnectorName()
Specified by:
getCurrentRMIConnectorName in interface ManagementRepr
Returns:
String the name of the current RMI connector. Return null if no RMI connector is available.

setCurrentRMIConnectorName

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

Specified by:
setCurrentRMIConnectorName in interface ManagementRepr
Throws:
java.lang.Exception

resetCurrentRMIConnectorName

public void resetCurrentRMIConnectorName()
Set the currentRMIConnectorName to null

Specified by:
resetCurrentRMIConnectorName in interface ManagementRepr

getRMIConnectorsNames

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

getJonasNamingServiceURL

public java.lang.String getJonasNamingServiceURL()
Specified by:
getJonasNamingServiceURL in interface ManagementRepr
Returns:
String the value of the PROVIDER_URL property in the current context.

setJonasNamingServiceURL

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

Specified by:
setJonasNamingServiceURL in interface ManagementRepr
Throws:
javax.naming.NamingException

setNamingEnvCtx

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

Specified by:
setNamingEnvCtx in interface ManagementRepr
Parameters:
env - properties to create a new naming context
Throws:
javax.naming.NamingException