Search in sources :

Example 16 with StandardMBean

use of javax.management.StandardMBean in project fabric8 by jboss-fuse.

the class ClusterServiceManager method activate.

@Activate
void activate() throws Exception {
    StandardMBean mbean = new StandardMBean(this, ClusterServiceManagerMBean.class);
    JMXUtils.registerMBean(mbean, mbeanServer.get(), OBJECT_NAME);
    activateComponent();
}
Also used : StandardMBean(javax.management.StandardMBean) Activate(org.apache.felix.scr.annotations.Activate)

Example 17 with StandardMBean

use of javax.management.StandardMBean in project fabric8 by jboss-fuse.

the class FileSystem method registerMBeanServer.

public void registerMBeanServer(ShutdownTracker shutdownTracker, MBeanServer mbeanServer) {
    try {
        ObjectName name = getObjectName();
        if (!mbeanServer.isRegistered(name)) {
            StandardMBean mbean = new StandardMBean(this, FileSystemMBean.class);
            mbeanServer.registerMBean(mbean, name);
        }
    } catch (Exception e) {
        LOG.warn("An error occurred during mbean server registration: " + e, e);
    }
}
Also used : StandardMBean(javax.management.StandardMBean) MalformedObjectNameException(javax.management.MalformedObjectNameException) IOException(java.io.IOException) ObjectName(javax.management.ObjectName)

Example 18 with StandardMBean

use of javax.management.StandardMBean in project fabric8 by jboss-fuse.

the class MetaTypeFacade method activate.

@Activate
void activate(BundleContext bundleContext) throws Exception {
    this.bundleContext = bundleContext;
    bundleUtils = new BundleUtils(bundleContext);
    Objects.notNull(metaTypeService, "metaTypeService");
    Objects.notNull(bundleContext, "bundleContext");
    if (mbeanServer != null) {
        StandardMBean mbean = new StandardMBean(this, MetaTypeFacadeMXBean.class);
        JMXUtils.registerMBean(mbean, mbeanServer, OBJECT_NAME);
    }
}
Also used : StandardMBean(javax.management.StandardMBean) BundleUtils(io.fabric8.utils.BundleUtils) Activate(org.apache.felix.scr.annotations.Activate)

Example 19 with StandardMBean

use of javax.management.StandardMBean in project fabric8 by jboss-fuse.

the class MXBeansProvider method activateInternal.

private void activateInternal() {
    MBeanServer server = mbeanServer.get();
    try {
        ProfileManagement profileMXBean = new ProfileManagementImpl();
        server.registerMBean(new StandardMBean(profileMXBean, ProfileManagement.class, true), new ObjectName(ProfileManagement.OBJECT_NAME));
    } catch (JMException ex) {
        throw new IllegalStateException(ex);
    }
}
Also used : ProfileManagement(io.fabric8.api.mxbean.ProfileManagement) StandardMBean(javax.management.StandardMBean) JMException(javax.management.JMException) MBeanServer(javax.management.MBeanServer) ObjectName(javax.management.ObjectName)

Example 20 with StandardMBean

use of javax.management.StandardMBean in project fabric8 by jboss-fuse.

the class FabricHTTPGatewayInfo method registerMBeanServer.

public void registerMBeanServer(ShutdownTracker shutdownTracker, MBeanServer mbeanServer) {
    try {
        ObjectName name = getObjectName();
        if (!mbeanServer.isRegistered(name)) {
            StandardMBean mbean = new StandardMBean(this, FabricGatewayInfoMBean.class);
            mbeanServer.registerMBean(mbean, name);
        }
    } catch (Exception e) {
        LOG.warn("An error occurred during mbean server registration: " + e, e);
    }
}
Also used : StandardMBean(javax.management.StandardMBean) MalformedObjectNameException(javax.management.MalformedObjectNameException) ObjectName(javax.management.ObjectName)

Aggregations

StandardMBean (javax.management.StandardMBean)70 ObjectName (javax.management.ObjectName)32 NotCompliantMBeanException (javax.management.NotCompliantMBeanException)21 MBeanServer (javax.management.MBeanServer)17 MalformedObjectNameException (javax.management.MalformedObjectNameException)16 InstanceAlreadyExistsException (javax.management.InstanceAlreadyExistsException)12 MBeanRegistrationException (javax.management.MBeanRegistrationException)9 Test (org.junit.Test)9 JMException (javax.management.JMException)7 IOException (java.io.IOException)6 Logger (org.apache.aries.jmx.Logger)6 InstanceNotFoundException (javax.management.InstanceNotFoundException)5 Activate (org.apache.felix.scr.annotations.Activate)5 IgniteStandardMXBean (org.apache.ignite.internal.mxbean.IgniteStandardMXBean)5 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)5 MBeanInfo (javax.management.MBeanInfo)4 OpenDataException (javax.management.openmbean.OpenDataException)4 MBeanAttributeInfo (javax.management.MBeanAttributeInfo)3 CompositeType (javax.management.openmbean.CompositeType)3 OpenType (javax.management.openmbean.OpenType)3