Search in sources :

Example 16 with ObjectNameBuilder

use of org.apache.openejb.monitoring.ObjectNameBuilder in project tomee by apache.

the class SimpleRouter method JMXOn.

public void JMXOn(final String name) {
    final ObjectNameBuilder jmxName = new ObjectNameBuilder("openejb.management");
    jmxName.set("J2EEServer", "Router");
    jmxName.set("J2EEApplication", name);
    jmxName.set("Type", "SimpleRouter");
    objectName = jmxName.build();
    try {
        LocalMBeanServer.get().registerMBean(new DynamicMBeanWrapper(this), objectName);
    } catch (final Exception e) {
        objectName = null;
    }
}
Also used : ObjectNameBuilder(org.apache.openejb.monitoring.ObjectNameBuilder) DynamicMBeanWrapper(org.apache.openejb.monitoring.DynamicMBeanWrapper) OpenDataException(javax.management.openmbean.OpenDataException) ServletException(javax.servlet.ServletException) IOException(java.io.IOException)

Aggregations

ObjectNameBuilder (org.apache.openejb.monitoring.ObjectNameBuilder)16 ObjectName (javax.management.ObjectName)10 MBeanServer (javax.management.MBeanServer)8 LocalMBeanServer (org.apache.openejb.monitoring.LocalMBeanServer)8 NamingException (javax.naming.NamingException)6 OpenEJBException (org.apache.openejb.OpenEJBException)6 ApplicationException (org.apache.openejb.ApplicationException)5 ManagedMBean (org.apache.openejb.monitoring.ManagedMBean)5 StatsInterceptor (org.apache.openejb.monitoring.StatsInterceptor)5 IOException (java.io.IOException)4 EJBContext (javax.ejb.EJBContext)4 Context (javax.naming.Context)4 BeanContext (org.apache.openejb.BeanContext)4 OpenEJBRuntimeException (org.apache.openejb.OpenEJBRuntimeException)4 SystemException (org.apache.openejb.SystemException)4 InstanceContext (org.apache.openejb.core.InstanceContext)4 ThreadContext (org.apache.openejb.core.ThreadContext)4 InterceptorData (org.apache.openejb.core.interceptor.InterceptorData)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)3 RemoteException (java.rmi.RemoteException)3