Package javax.management

Examples of javax.management.StandardMBean$StandardMBeanSupport


    public void startInternalMBeans() {
        for ( EntryPointNode epn : kbase.getRete().getEntryPointNodes().values() ) {
            for ( ObjectTypeNode otn : epn.getObjectTypeNodes().values() ) {
                ObjectTypeNodeMonitor otnm = new ObjectTypeNodeMonitor( otn );
                try {
                    final StandardMBean adapter = new StandardMBean(otnm, ObjectTypeNodeMonitorMBean.class);
                    ObjectName name = DroolsManagementAgent.createObjectName( this.name.getCanonicalName() + ",group=EntryPoints,EntryPoint=" + otnm.getNameSufix() + ",ObjectType=" + ((ClassObjectType) otn.getObjectType()).getClassName() );
                    DroolsManagementAgent.getInstance().registerMBean( kbase,
                                                                       adapter,
                                                                       name );
                } catch ( NotCompliantMBeanException e ) {
                    logger.error( "Unable to register ObjectTypeNodeMonitor mbean for OTN "+otn.getObjectType()+" into the platform MBean Server", e);
                }
            }
        }
        final KieBaseConfigurationMonitor kbcm = new KieBaseConfigurationMonitor( kbase.getConfiguration() );
        try {
            final StandardMBean adapter = new StandardMBean(kbcm, KieBaseConfigurationMonitorMBean.class);
            ObjectName name = DroolsManagementAgent.createObjectName( this.name.getCanonicalName() + ",group=Configuration" );
            DroolsManagementAgent.getInstance().registerMBean( kbase,
                                                               adapter,
                                                               name );
        } catch ( NotCompliantMBeanException e ) {
View Full Code Here


            try
            {
               JMSBridgeControlImpl controlBean = new JMSBridgeControlImpl(this);
               this.objectName = ObjectName.getInstance(objectName);
               StandardMBean mbean = new StandardMBean(controlBean, JMSBridgeControl.class);
               mbeanServer.registerMBean(mbean, this.objectName);
               JMSBridgeImpl.log.debug("Registered JMSBridge instance as: " + this.objectName.getCanonicalName());
            }
            catch (Exception e)
            {
View Full Code Here

   */
  void registerMBean(Configuration conf) {
    // We wrap to bypass standard mbean naming convention.
    // This wraping can be removed in java 6 as it is more flexible in
    // package naming for mbeans and their impl.
    StandardMBean bean;
    try {
      bean = new StandardMBean(this,FSNamesystemMBean.class);
      mbeanName = MBeans.register("NameNode", "FSNamesystemState", bean);
    } catch (NotCompliantMBeanException e) {
      e.printStackTrace();
    }
    mxBean = MBeans.register("NameNode", "NameNodeInfo", this);
View Full Code Here

         // the resource extends StandardMBean
         if (resourceType.equals(STANDARD_MBEAN) &&
             resource instanceof StandardMBean)
         {
            StandardMBean standardMBean = (StandardMBean) resource;
            info = MBeanInfoConversion.toModelMBeanInfo(standardMBean.getMBeanInfo(),
                                                        CREATE_ATTRIBUTE_OPERATION_MAPPING);
         }

         // the resource implements a Standard MBean interface
         else if ((resourceType.equals(STANDARD_INTERFACE)) ||
View Full Code Here

   public void testSpecifyManagementInterface()
      throws Exception
   {
      MBeanServer server = MBeanServerFactory.newMBeanServer();
      ObjectName name = new ObjectName("test:test=test");
      server.registerMBean(new StandardMBean(new MyRunnable(), Runnable.class), name);
      server.invoke(name, "run", new Object[0], new String[0]);
   }
View Full Code Here

   public void testDontSpecifyManagementInterface()
      throws Exception
   {
      MBeanServer server = MBeanServerFactory.newMBeanServer();
      ObjectName name = new ObjectName("test:test=test");
      server.registerMBean(new StandardMBean(new Trivial(), null), name);
      server.invoke(name, "doOperation", new Object[] { "arg" }, new String[] { String.class.getName() });
   }
View Full Code Here

   }

   public void testGetImplementationImplied()
      throws Exception
   {
      StandardMBean std = new MBeanRunnable();
      assertTrue("MBeanRunnable is its own implementation", std == std.getImplementation());
      assertTrue("MBeanRunnable is its own implementation class", std.getClass() == std.getImplementationClass());
   }
View Full Code Here

   public void testGetImplementationSpecified()
      throws Exception
   {
      Object obj = new MyRunnable();
      StandardMBean std = new StandardMBean(obj, Runnable.class);
      assertTrue("MyRunnable is the implementation", obj == std.getImplementation());
      assertTrue("MyRunnable is the implementation class", obj.getClass() == std.getImplementationClass());
   }
View Full Code Here

   }

   public void testMBeanInterfaceImplied()
      throws Exception
   {
      StandardMBean std = new MBeanRunnable();
      assertTrue("MBeanRunnable has Runnable as a management interface", Runnable.class == std.getMBeanInterface());
   }
View Full Code Here

   public void testMBeanInterfaceSpecified()
      throws Exception
   {
      Object obj = new MyRunnable();
      StandardMBean std = new StandardMBean(obj, Runnable.class);
      assertTrue("MyRunnable has Runnable as a management interface", Runnable.class == std.getMBeanInterface());
   }
View Full Code Here

TOP

Related Classes of javax.management.StandardMBean$StandardMBeanSupport

Copyright © 2018 www.massapicom. 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.