Package javax.management

Examples of javax.management.NotificationFilter


   }

   public boolean getInvokeFilter()
   {
      if (!invokeFilter) return false;
      NotificationFilter filter = getNotificationFilter();
      if (filter == null) return false;
      return true;
   }
View Full Code Here


    @Override
    protected void initRegistry() {
        super.initRegistry();

        // initialize the registry with our filter
        getRegistry().put("myFilter", new NotificationFilter() {
            public boolean isNotificationEnabled(Notification aNotification) {
                // only accept even notifications
                boolean enabled = aNotification.getSequenceNumber() % 2 == 0;
                if (!enabled) {
                    mRejected.add(aNotification);
View Full Code Here

   {
      log.info("addNotificationListener, listener: " + listener + ", handback: " + handback);
      super.addNotificationListener(listener, filter, handback);
      if(filter instanceof NotificationFilterProxy)
      {
         NotificationFilter delegateFilter = ((NotificationFilterProxy)filter).getFilter();
         if(delegateFilter instanceof RunTimerFilter)
         {
            Timer t = new Timer();
            Send10Notifies task = new Send10Notifies();
            t.scheduleAtFixedRate(task, 0, 1000);
View Full Code Here

   {
      ListenerRegistry.ListenerRegistrationIterator iterator = registry.iterator();
      while(iterator.hasNext())
      {
         ListenerRegistration registration = iterator.nextRegistration();
         NotificationFilter filter = registration.getFilter();
         if(filter == null)
         {
            handleNotification(registration.getListener(), notification, registration.getHandback());
         }
         else if(filter.isNotificationEnabled(notification))
         {
            handleNotification(registration.getListener(), notification, registration.getHandback());
         }
      }
   }
View Full Code Here

   }

   public void addNotificationListener(ObjectName name, ObjectName listener, MarshalledObject filter, MarshalledObject handback, Subject delegationSubject) throws InstanceNotFoundException, IOException
   {
      ClassLoader mbeanLoader = rmiServer.getMBeanServer().getClassLoaderFor(name);
      NotificationFilter f = (NotificationFilter) loadMarshalledObject(mbeanLoader, filter);
      Object o = loadMarshalledObject(mbeanLoader, handback);
      rmiServer.getMBeanServer().addNotificationListener(name, listener, f, o);
   }
View Full Code Here

   }

   public void removeNotificationListener(ObjectName name, ObjectName listener, MarshalledObject filter, MarshalledObject handback, Subject delegationSubject) throws InstanceNotFoundException, ListenerNotFoundException, IOException
   {
      ClassLoader mbeanLoader = rmiServer.getMBeanServer().getClassLoaderFor(name);
      NotificationFilter f = (NotificationFilter) loadMarshalledObject(mbeanLoader, filter);
      Object o = loadMarshalledObject(mbeanLoader, handback);
      rmiServer.getMBeanServer().removeNotificationListener(name, listener, f, o);
   }
View Full Code Here

   {

      for(int x = 0; x < listenerIDs.length; ++x)
      {
         Integer id = listenerIDs[x];
         NotificationFilter filter = notificationProxy.removeListener(id);
         rmiServer.getMBeanServer().removeNotificationListener(name, notificationProxy, filter, id);
      }
   }
View Full Code Here

   protected void initNotificationReception () throws Exception
   {
      ObjectName mbsDelegate =
         new ObjectName ("JMImplementation:type=MBeanServerDelegate");

      NotificationFilter filter = new NotificationFilter ()
      {
         public boolean isNotificationEnabled (Notification n)
         {
            return ( n.getType().equals("JMX.mbean.registered") ||
                      n.getType().equals("JMX.mbean.unregistered") );
View Full Code Here

      }
   }

   private NotificationFilter createFilterForServer(String id)
   {
      NotificationFilter serverfilter = null;
      NotificationFilter nfilter = new MBeanTrackerFilter(id, classes, wantNotifications);
      if(filter == null)
      {
         serverfilter = nfilter;
      }
      else
View Full Code Here

                set.toArray(candidates);
            }
            // We don't synchronize on targetedNotifs, because it is a local
            // variable of our caller and no other thread can see it.
            for (IdAndFilter idaf : candidates) {
                final NotificationFilter nf = idaf.getFilter();
                if (nf == null || nf.isNotificationEnabled(notif)) {
                    logger.debug("bufferFilter", "filter matches");
                    final TargetedNotification tn =
                            new TargetedNotification(notif, idaf.getId());
                    if (allowNotificationEmission(source, tn))
                        targetedNotifs.add(tn);
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.