Package javax.management

Examples of javax.management.NotificationFilter


      getServer().addNotificationListener
      (
         managedConnectionFactoryName,
         this,
         new NotificationFilter()
         {
            private static final long serialVersionUID = -9211456539783257343L;

            public boolean isNotificationEnabled(Notification n)
            {
View Full Code Here


               if( addNotificationListeners.contains(method) )
               {
                  ObjectName name = (ObjectName) args[0];
                  RMINotificationListener listener = (RMINotificationListener)
                     args[1];
                  NotificationFilter filter = (NotificationFilter) args[2];
                  Object handback = args[3];
                  addNotificationListener(name, listener, filter, handback);
               }
               else if( removeNotificationListeners.contains(method) )
               {
View Full Code Here

   }

   public void addNotificationListener(ObjectName name, ObjectName listener, MarshalledObject filter, MarshalledObject handback, Subject delegate)
           throws InstanceNotFoundException, IOException
   {
      NotificationFilter f = (NotificationFilter)RMIMarshaller.unmarshal(filter, server.getClassLoaderFor(name), defaultLoader);
      Object h = RMIMarshaller.unmarshal(handback, server.getClassLoaderFor(name), 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
   {
      NotificationFilter f = (NotificationFilter)RMIMarshaller.unmarshal(filter, server.getClassLoaderFor(name), defaultLoader);
      Object h = RMIMarshaller.unmarshal(handback, server.getClassLoaderFor(name), 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, server.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

   }

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


      if (tuple.getInvokeFilter())
      {
         // Invoke the filter on client side
         NotificationFilter filter = tuple.getNotificationFilter();
         RmiConnectorActivator.log(LogService.LOG_DEBUG,"Filtering notification " + notif + ", filter = " + filter,null);
         if (filter != null)
         {
            try
            {
               boolean deliver = filter.isNotificationEnabled(notif);
               if (!deliver) return;
            }
            catch (RuntimeException x)
            {
               RmiConnectorActivator.log(LogService.LOG_WARNING,"RuntimeException caught from isNotificationEnabled, filter = " + filter, x);
View Full Code Here

      ListenerRegistration other = (ListenerRegistration) obj;

      if (getRegisteredListener().equals(other.getRegisteredListener()) == false)
         return false;

      NotificationFilter myFilter = getRegisteredFilter();
      NotificationFilter otherFilter = other.getRegisteredFilter();
      if (myFilter != null && myFilter.equals(otherFilter) == false)
         return false;
      else if (myFilter == null && otherFilter != null)
         return false;
View Full Code Here

        String methodName = method.getName();

        if (methodName.equals("addNotificationListener") && args != null)
        {
            NotificationListener notiListener = (NotificationListener) args[0];
            NotificationFilter filter = (NotificationFilter) args[1];
            Object handback = args[2];

            // This will send along the real ObjectName and not the Proxy name.
            server.addNotificationListener(objectName, notiListener, filter, handback);
            return null;
View Full Code Here

      Logger logger = getLogger();

      if (tuple.getInvokeFilter())
      {
         // Invoke the filter on client side
         NotificationFilter filter = tuple.getNotificationFilter();
         if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Filtering notification " + notif + ", filter = " + filter);
         if (filter != null)
         {
            try
            {
               boolean deliver = filter.isNotificationEnabled(notif);
               if (!deliver) return;
            }
            catch (Throwable x)
            {
               logger.warn("Throwable caught from isNotificationEnabled, filter = " + filter, x);
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.