Package javax.management

Examples of javax.management.AttributeChangeNotificationFilter


      ejbModuleName = ejbModule.getServiceName().toString();

      // we register our inner-class to retrieve STATE notifications from our container
      //
      AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter ();
      filter.enableAttribute ("State");

      this.container.getServer ().
         addNotificationListener (this.container.getEjbModule ().getServiceName (),
                                  new CleanShutdownInterceptor.StateChangeListener (),
                                  filter,
View Full Code Here


   public void createService() throws Exception
   {
      super.createService();
     
      // we register our inner-class to retrieve STATE notifications from our container
      AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter();
      filter.enableAttribute("State");
      listener = new StateChangeListener();
      getServer().addNotificationListener(getTargetName(), listener, filter, null);
   }
View Full Code Here

   {
      super.create ();
     
      // we register our inner-class to retrieve STATE notifications from our container
      //
      AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter ();
      filter.enableAttribute ("State");
     
      // ************************************************************************
      // NOTE: We could also subscribe for the container service events instead of the
      // ejbModule service events. This problem comes from beans using other beans
      // in the same ejbModule: we may receive an IllegalStateException thrown
View Full Code Here

   public void addAttributeChangeNotificationListener(
         NotificationListener listener,
         String attributeName,
         Object handback) throws MBeanException
   {
      AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter();
      filter.enableAttribute(attributeName);
      notifier.addNotificationListener(listener, filter, handback);
   }
View Full Code Here

     * @throws RuntimeOperationsException
     * @throws IllegalArgumentException
     */
    public void addAttributeChangeNotificationListener(NotificationListener l, String attrName, Object handback)
            throws MBeanException, RuntimeOperationsException, IllegalArgumentException {
        AttributeChangeNotificationFilter currFilter = new AttributeChangeNotificationFilter();
        currFilter.enableAttribute(attrName);
        broadcasterSupport.addNotificationListener(l, currFilter, handback);
    }
View Full Code Here

{
   protected boolean registered = false;

   protected void startObserving() throws Exception
   {
      AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter();
      filter.enableAttribute(observedAttribute);
      server.addNotificationListener(observedName, this, filter, null);
      registered = true;
   }
View Full Code Here

   }

   public void addAttributeChangeNotificationListener(NotificationListener listener, String attributeName, Object handback) throws MBeanException, RuntimeOperationsException, IllegalArgumentException
   {
      if (listener == null) throw new IllegalArgumentException("Listener cannot be null");
      AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter();
      if (attributeName != null)
      {
         if (m_modelMBeanInfo.getAttribute(attributeName) == null) throw new RuntimeOperationsException(new IllegalArgumentException("No attribute named " + attributeName));
         filter.enableAttribute(attributeName);
      }
      else
      {
         MBeanAttributeInfo[] ai = m_modelMBeanInfo.getAttributes();
         for (int i = 0; i < ai.length; i++)
         {
            Descriptor d = ((ModelMBeanAttributeInfo)ai[i]).getDescriptor();
            filter.enableAttribute((String)d.getFieldValue("name"));
         }
      }

      getAttributeChangeBroadcaster().addNotificationListener(listener, filter, handback);
View Full Code Here

   // Not in the spec but needed
   private void removeAttributeChangeNotificationListener(NotificationListener listener, String attributeName, Object handback) throws MBeanException, RuntimeOperationsException, ListenerNotFoundException
   {
      if (listener == null) throw new ListenerNotFoundException("listener is null");
      AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter();
      if (attributeName != null)
      {
         if (m_modelMBeanInfo.getAttribute(attributeName) == null) throw new RuntimeOperationsException(new IllegalArgumentException("No attribute named " + attributeName));
         filter.enableAttribute(attributeName);
      }
      else
      {
         MBeanAttributeInfo[] ai = m_modelMBeanInfo.getAttributes();
         for (int i = 0; i < ai.length; i++)
         {
            Descriptor d = ((ModelMBeanAttributeInfo)ai[i]).getDescriptor();
            filter.enableAttribute((String)d.getFieldValue("name"));
         }
      }

      getAttributeChangeBroadcaster().removeNotificationListener(listener, filter, handback);
View Full Code Here

   // Not in the spec but needed
   private void removeAttributeChangeNotificationListener(NotificationListener listener, String attributeName, Object handback) throws MBeanException, RuntimeOperationsException, ListenerNotFoundException
   {
      if (listener == null) throw new ListenerNotFoundException("listener is null");
      AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter();
      if (attributeName != null)
      {
         if (m_modelMBeanInfo.getAttribute(attributeName) == null) throw new RuntimeOperationsException(new IllegalArgumentException("No attribute named " + attributeName));
         filter.enableAttribute(attributeName);
      }
      else
      {
         MBeanAttributeInfo[] ai = m_modelMBeanInfo.getAttributes();
         for (int i = 0; i < ai.length; i++)
         {
            Descriptor d = ((ModelMBeanAttributeInfo)ai[i]).getDescriptor();
            filter.enableAttribute((String)d.getFieldValue("name"));
         }
      }

      getAttributeChangeBroadcaster().removeNotificationListener(listener, filter, handback);
View Full Code Here

      return notification;
   }

   public AttributeChangeNotificationFilter createAttributeChangeNotificationFilter()
   {
      AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter();
      filter.enableAttribute("attribute-name");
      return filter;
   }
View Full Code Here

TOP

Related Classes of javax.management.AttributeChangeNotificationFilter

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.