Package javax.management

Examples of javax.management.NotificationFilter


            Mbean definedActionMBean, boolean isSystemDefined, Object handback)
      throws InstanceNotFoundException, MalformedObjectNameException,
            CustomMBeanException {
       ObjectName actionObjName = null;
       ObjectName eventObjName = ruleEvent.getObjectName();
       NotificationFilter filter = ruleEvent.getNotificationFilter();

       try {
            //check if this is a system defined rule then explictly load the MBean      
            if (isSystemDefined) {
                CustomMBeanRegistration obj = getCustomMBeanRegistration();
View Full Code Here


    
       try {
           if (ruleInstance.getState() == Rule.ENABLED) {
               //remove the event action binding
               NotificationFilter filter = ruleEvent.getNotificationFilter();
               ObjectName eventObjName = ruleEvent.getObjectName();
               ObjectName actionObjName = (ObjectName)ruleInstance.getAction();

               instanceMbs.removeNotificationListener(eventObjName,actionObjName,
                                                      filter, null);
View Full Code Here

        Event ruleEvent = null;
        Rule ruleInstance = null;
        try {
            ruleInstance = getRuleInstance(name);
            ruleEvent = ruleInstance.getEvent();
            NotificationFilter filter = ruleEvent.getNotificationFilter();
            ObjectName eventObjName = ruleEvent.getObjectName();
            ObjectName actionObjName = (ObjectName)ruleInstance.getAction();
            instanceMbs.removeNotificationListener(eventObjName,actionObjName,
                                                   filter, null);
            setupRuleBinding(Rule.NOACTION, ruleInstance, ruleEvent, null);
View Full Code Here

       protected void
     addNotificationListener( final Object[] args )
       throws IOException, InstanceNotFoundException
     {
       final NotificationListener  listener  = (NotificationListener)args[ 0 ];
       final NotificationFilter  filter    = (NotificationFilter)(args.length <= 1 ? null : args[ 1 ]);
       final Object        handback  = args.length <= 1 ? null : args[ 2 ];
      
       getConnection().addNotificationListener(
         getTargetObjectName(), listener, filter, handback );
     }
View Full Code Here

       {
           getConnection().removeNotificationListener( getTargetObjectName(), listener );
       }
       else
       {
           final NotificationFilter filter    = (NotificationFilter)args[ 1 ];
           final Object             handback  = args[ 2 ];
          
           getConnection().removeNotificationListener(
             getTargetObjectName(), listener, filter, handback );
         }
View Full Code Here

         MBeanServerConnection mbsc = cntor.getMBeanServerConnection();

         // Non-serializable filter
         try
         {
            mbsc.addNotificationListener(emitterName, listenerName, new NotificationFilter()
            {
               public boolean isNotificationEnabled(Notification notification)
               {
                  return false;
               }
            }, null);
            fail();
         } catch (IOException x)
         {
         }

         // Non-serializable handback
         try
         {
            mbsc.addNotificationListener(emitterName, listenerName, null, new Object());
            fail();
         } catch (IOException x)
         {
         }

         // Non-serializable filter and non serializable handback
         try
         {
            mbsc.addNotificationListener(emitterName, listenerName, new NotificationFilter()
            {
               public boolean isNotificationEnabled(Notification notification)
               {
                  return false;
               }
View Full Code Here

         cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
         MBeanServerConnection mbsc = cntor.getMBeanServerConnection();

         // Non-serializable filter, should run on client side
         final MutableBoolean enable = new MutableBoolean(false);
         NotificationFilter filter = new NotificationFilter()
         {
            public boolean isNotificationEnabled(Notification notification)
            {
               return enable.get();
            }
View Full Code Here

   public void addNotificationListener(ObjectName name, ObjectName listener, MarshalledObject filter, MarshalledObject handback, Subject delegate)
           throws InstanceNotFoundException, IOException
   {
      ClassLoader loader = getClassLoaderFor(name);
      NotificationFilter f = (NotificationFilter)RMIMarshaller.unmarshal(filter, loader, defaultLoader);
      Object h = RMIMarshaller.unmarshal(handback, loader, defaultLoader);
      server.addNotificationListener(name, listener, f, h);
   }
View Full Code Here

   public void removeNotificationListener(ObjectName name, ObjectName listener, MarshalledObject filter, MarshalledObject handback, Subject delegate)
           throws InstanceNotFoundException, ListenerNotFoundException, IOException
   {
      ClassLoader loader = getClassLoaderFor(name);
      NotificationFilter f = (NotificationFilter)RMIMarshaller.unmarshal(filter, loader, defaultLoader);
      Object h = RMIMarshaller.unmarshal(handback, loader, defaultLoader);
      server.removeNotificationListener(name, listener, f, h);
   }
View Full Code Here

      ArrayList ids = new ArrayList();
      for (int i = 0; i < names.length; ++i)
      {
         ObjectName name = names[i];
         MarshalledObject filter = filters[i];
         NotificationFilter f = (NotificationFilter)RMIMarshaller.unmarshal(filter, getClassLoaderFor(name), defaultLoader);
         Integer id = notificationHandler.generateListenerID(name, f);
         NotificationListener listener = notificationHandler.getServerNotificationListener();
         server.addNotificationListener(name, listener, f, id);
         notificationHandler.addNotificationListener(id, new NotificationTuple(name, listener, f, id));
         ids.add(id);
View Full Code Here

TOP

Related Classes of javax.management.NotificationFilter

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.