Package javax.management

Examples of javax.management.MBeanServer.registerMBean()


    }

    private static void setupMonitor(IoAcceptor service) {
        final MBeanServer server = ManagementFactory.getPlatformMBeanServer();
        try {
            server.registerMBean(new IoServiceMBean(service), new ObjectName("org.apache.mina:type=service,name="
                    + SRV_NAME));
        } catch (InstanceAlreadyExistsException iaee) {
            throw new IllegalStateException(iaee);
        } catch (MBeanRegistrationException mre) {
            throw new IllegalStateException(mre);
View Full Code Here


  }
 
  private void register(String name, Object bean, ObjectName mbeanObjectName) throws MBeanRegistrationException, NotCompliantMBeanException {
    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
    try {
      mbs.registerMBean(bean, mbeanObjectName);
      log.info("Dozer JMX MBean [" + name + "] auto registered with the Platform MBean Server");
    } catch (InstanceAlreadyExistsException e) {
      log.info("JMX MBean instance exists, unable to overwrite [{}].", name);
    }
  }
View Full Code Here

     */
    try {
      MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
      ObjectName name = new ObjectName("xBus:mbean=Administrator");
      Administrator mbean = new Administrator();
      mbs.registerMBean(mbean, name);
    } catch (Exception e) {
      throw new XException(Constants.LOCATION_INTERN,
          Constants.LAYER_ADMIN, Constants.PACKAGE_ADMIN_JMX, "0", e);
    }

View Full Code Here

      String host = get("host", "0.0.0.0");
      String adaptorName = get("adaptorName", "HttpAdaptorMX4J");
      MBeanServer server = global.getJmxWrapper().getMBeanServer();
      HttpAdaptor adapter = new HttpAdaptor();
      this.name = new ObjectName("Adaptor:name=" + adaptorName);
      server.registerMBean(adapter, name);
      adapter.setHost(host);
      adapter.setPort(port);
      this.authMethod = get("authenticationMethod", null);
      log.info("Authentication Method is '" + this.authMethod + "'");
      if (this.authMethod != null) {
View Full Code Here

         processorName = new ObjectName(JmxWrapper.getObjectNameLiteral(this.global, contextNode));
        
         // XSLTProcessor processor = new XSLTProcessor();
         ContribXsltProcessor processor = new ContribXsltProcessor(this.roles, this.authMethod);
        
         server.registerMBean(processor, processorName);
        
         // set it to use a dir
         String xsltPath = get("xsltPath", null); // can be a directory or a jar file
         String xsltPathInJar = null;
View Full Code Here

        //register to the bus MBServer       
        Bus bus = Bus.getCurrent();
        MBeanServer mbserver = bus.getInstrumentationManager().getMBeanServer();
        ObjectName name = new ObjectName("org.objectweb.celtix.instrumentation:type=ServerMBean,Bus="
                        + bus.getBusID() + ",name=ServerMBean");
        mbserver.registerMBean(this, name);
    }

    public String getServiceName() {
        return "SoapService";
    }
View Full Code Here

      // Unique identification of MBeans
      Statistics statBean = Statistics.getStatistics();
      // Uniquely identify the MBeans and register them with the platform
      // MBeanServer
      ObjectName statName = new ObjectName("marauroad:name=Statistics");
      mbs.registerMBean(statBean, statName);
      logger.debug("Statistics bean registered.");
    } catch (Exception e) {
      logger.error("cannot register statistics bean, continuing anyway.", e);
    }
  }
View Full Code Here

public class MBeanTest extends TestSupport {

    public void testGetProperty() throws Exception {
        MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer();
        ObjectName name = new ObjectName("groovy.test:role=TestMBean,type=Dummy");
        mbeanServer.registerMBean(new Dummy(), name);

        assertEquals("JMX value of Name", "James", mbeanServer.getAttribute(name, "Name"));

        GroovyObject object = new GroovyMBean(mbeanServer, name);
View Full Code Here

    public static void registerMBean(Object instance, String objName) {
        try {
            ObjectName objectName = new ObjectName(objName);
            /* register with JSR160 MBean Server*/
            MBeanServer server = getMBeanServer();
            server.registerMBean(instance, objectName);
            /* register with JDK 1.5 MBean server */
            ManagementFactory.getPlatformMBeanServer().registerMBean(instance, objectName);
            logger.info("registered MBean: " + objName);
        } catch (Exception e) {
            logger.log(Level.SEVERE, "Failed to register MBean: " + objName, e);
View Full Code Here

            ObjectName name;
            try
            {
                name = new ObjectName( "de.netseeker.ejoe.jmx:type=EJServerConfig" );
                mbeanServer.registerMBean( server.getJMXConfigurationBean(), name );
            }
            catch ( Exception e )
            {
                e.printStackTrace();
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.