Package javax.management

Examples of javax.management.MBeanServer.addNotificationListener()


 
  public JBossLifeCycleListener() {
    try {
      MBeanServer server = MBeanServerFactory.findMBeanServer(null).get(0);
      ObjectName on = new ObjectName("jboss.system:type=Server"); //$NON-NLS-1$
      server.addNotificationListener(on, this, null, null);
    } catch (MalformedObjectNameException e) {
      //ignore
    } catch (InstanceNotFoundException e) {
      //ignore
    }
View Full Code Here


            ObjectName executorName = ((ObjectInstance) it.next()).getObjectName();
            executorNames.add(executorName);
        }

        // Register with MBean server
        server.addNotificationListener(new ObjectName("JMImplementation:type=MBeanServerDelegate"), this, null, null);

    }

    public synchronized List getThreadPools() throws Exception {
View Full Code Here

      else
      {
         // Register for notification of the overall server startup
         log.debug("Server '" + ServerImplMBean.OBJECT_NAME + "' not started, registering for start-up notification");

         server.addNotificationListener(ServerImplMBean.OBJECT_NAME, this, null, null);
      }

   }

   /**
 
View Full Code Here

      {
         MBeanServer server = this.getMBeanServer();
        
         if (server.isRegistered(TomcatDeployer.TOMCAT_SERVICE_NAME))
         {
            server.addNotificationListener(TomcatDeployer.TOMCAT_SERVICE_NAME, this, null, null);
         }
      }
      catch (Exception e)
      {
         throw new LifecycleException(e);
View Full Code Here

        ObjectName delegate=new ObjectName("JMImplementation:type=MBeanServerDelegate");

        // XXX need to extract info about previously loaded beans

        // we'll know of all registered beans
        mserver.addNotificationListener(delegate, this, null, null );

    }

}
View Full Code Here

            beanName = ObjectName.getInstance(name);
            boolean notifications = server.isInstanceOf(beanName, NotificationBroadcaster.class.getName());

            if (notifications && file != null && file.exists()) {
                listener = new FileNotificationListener(file);
                server.addNotificationListener(beanName, listener, null, null);
            }
            result = server.invoke(beanName, operationName, parameterList.toArray(), signatureList.toArray(new String[0]));
        } catch (Exception e) {
            throw new OperationFailedException(e.getMessage(), e, new ModelNode().set(e.getMessage()));
        } finally {
View Full Code Here

      else
      {
         // Register for notification of the overall server startup
         log.debug("Server '" + ServerImplMBean.OBJECT_NAME + "' not started, registering for start-up notification");

         server.addNotificationListener(ServerImplMBean.OBJECT_NAME, this, null, null);
      }

   }

   /**
 
View Full Code Here

        ObjectName delegate=new ObjectName("JMImplementation:type=MBeanServerDelegate");

        // XXX need to extract info about previously loaded beans

        // we'll know of all registered beans
        mserver.addNotificationListener(delegate, this, null, null );

    }

}
View Full Code Here

         try
         {
            support = new RelationSupport("id1", service, server,
                                          "relationTypeC", rolesC);
            addRelation(server, service, support, "test:type=support1");
            server.addNotificationListener(service, listener, null, null);
            support.setRole(roleCX2);
            on = new ObjectName("test:type=support1");
         }
         catch(Exception e)
         {
View Full Code Here

         try
         {
            support = new RelationSupport("id1", service, server,
                                          "relationTypeC", rolesC);
            addRelation(server, service, support, "test:type=support1");
            server.addNotificationListener(service, listener, null, null);
           
            support.setRoles(shouldBe);
            on = new ObjectName("test:type=support1");
         }
         catch(Exception e)
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.