org.ow2.petals.kernel.server
Class MBeanHelper

java.lang.Object
  extended by org.ow2.petals.kernel.server.MBeanHelper

public class MBeanHelper
extends java.lang.Object

This class helps the Launcher to register MBean

Author:
alouis

Field Summary
static java.lang.String ADMIN_MBEAN
           
static java.lang.String CURRENCY_TIME_LIMIT
           
static java.lang.String DEPLOYMENT_MBEAN
           
static java.lang.String DOMAIN
           
static java.lang.String ENDPOINT_MBEAN
           
static java.lang.String INSTALLATION_MBEAN
           
static java.lang.String LOGGER_MBEAN
           
static java.lang.String MONITORING_MBEAN
           
static java.lang.String PETALS_ADMIN
           
static java.lang.String PETALS_LOGGER
           
static java.lang.String ROUTER_MONITOR
           
 
Constructor Summary
MBeanHelper()
           
 
Method Summary
static javax.management.modelmbean.RequiredModelMBean createCustomMBean(java.lang.Object object, java.lang.Class<?> mbeanClass)
          Create a custom MBean which process the method isXXX, setXXX, or getXXX as getter only if an attribute is define in the class.
static javax.management.MBeanServer findLocalJMXServer(org.objectweb.fractal.api.Component petalsComposite)
          Find the local JMX server in the petals component
static void registerComponent(org.objectweb.fractal.api.control.ContentController contentController, java.lang.String fractalName, javax.management.MBeanServer jmxServer, java.lang.Class mbeanClass, java.lang.String mbeanName)
          Register a fractal component-service to the jmx server.
static void registerMBeans(org.objectweb.fractal.api.Component petalsComposite)
           
static javax.management.ObjectName retrieveServiceMBean(java.lang.String serviceName, javax.management.MBeanServer jmxServer)
          Return the MBean name from the jmx server with the specified pattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CURRENCY_TIME_LIMIT

public static java.lang.String CURRENCY_TIME_LIMIT

DOMAIN

public static final java.lang.String DOMAIN
See Also:
Constant Field Values

ADMIN_MBEAN

public static final java.lang.String ADMIN_MBEAN
See Also:
Constant Field Values

DEPLOYMENT_MBEAN

public static final java.lang.String DEPLOYMENT_MBEAN
See Also:
Constant Field Values

INSTALLATION_MBEAN

public static final java.lang.String INSTALLATION_MBEAN
See Also:
Constant Field Values

LOGGER_MBEAN

public static final java.lang.String LOGGER_MBEAN
See Also:
Constant Field Values

MONITORING_MBEAN

public static final java.lang.String MONITORING_MBEAN
See Also:
Constant Field Values

ENDPOINT_MBEAN

public static final java.lang.String ENDPOINT_MBEAN
See Also:
Constant Field Values

PETALS_ADMIN

public static final java.lang.String PETALS_ADMIN
See Also:
Constant Field Values

ROUTER_MONITOR

public static final java.lang.String ROUTER_MONITOR
See Also:
Constant Field Values

PETALS_LOGGER

public static final java.lang.String PETALS_LOGGER
See Also:
Constant Field Values
Constructor Detail

MBeanHelper

public MBeanHelper()
Method Detail

findLocalJMXServer

public static final javax.management.MBeanServer findLocalJMXServer(org.objectweb.fractal.api.Component petalsComposite)
                                                             throws org.objectweb.fractal.api.NoSuchInterfaceException,
                                                                    org.objectweb.fractal.adl.ADLException
Find the local JMX server in the petals component

Parameters:
petalsComposite - the petals component
Returns:
the local jmx server
Throws:
org.objectweb.fractal.api.NoSuchInterfaceException
org.objectweb.fractal.adl.ADLException

registerMBeans

public static final void registerMBeans(org.objectweb.fractal.api.Component petalsComposite)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

retrieveServiceMBean

public static final javax.management.ObjectName retrieveServiceMBean(java.lang.String serviceName,
                                                                     javax.management.MBeanServer jmxServer)
                                                              throws javax.management.MalformedObjectNameException
Return the MBean name from the jmx server with the specified pattern

Parameters:
serviceName - The name of the service to retrieve, must be null
jmxServer - The JMX server instance, must be non null
Returns:
the objectname, null if no object match
Throws:
javax.management.MalformedObjectNameException

registerComponent

public static final void registerComponent(org.objectweb.fractal.api.control.ContentController contentController,
                                           java.lang.String fractalName,
                                           javax.management.MBeanServer jmxServer,
                                           java.lang.Class mbeanClass,
                                           java.lang.String mbeanName)
                                    throws java.lang.Exception
Register a fractal component-service to the jmx server. Assume that the interface name of the fractal component is "service"

Parameters:
contentController - contentcontroller where the fractal comp can be found
fractalName - the name of the fractal comp
jmxServer - the jmx server to register to
mbeanClass - the interface of the mbean
mbeanName - the name of the mbean
Throws:
java.lang.Exception

createCustomMBean

public static final javax.management.modelmbean.RequiredModelMBean createCustomMBean(java.lang.Object object,
                                                                                     java.lang.Class<?> mbeanClass)
                                                                              throws javax.management.RuntimeOperationsException,
                                                                                     javax.management.MBeanException,
                                                                                     javax.management.InstanceNotFoundException,
                                                                                     javax.management.modelmbean.InvalidTargetObjectTypeException
Create a custom MBean which process the method isXXX, setXXX, or getXXX as getter only if an attribute is define in the class.

Parameters:
object -
mbeanClass -
Returns:
Throws:
javax.management.RuntimeOperationsException
javax.management.MBeanException
javax.management.InstanceNotFoundException
javax.management.modelmbean.InvalidTargetObjectTypeException


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.