Package javax.management

Examples of javax.management.NotificationFilter


   */
  private void registerNotificationListeners() throws MBeanExportException {
    for (int i = 0; i < this.notificationListeners.length; i++) {
      NotificationListenerBean bean = this.notificationListeners[i];
      NotificationListener listener = bean.getNotificationListener();
      NotificationFilter filter = bean.getNotificationFilter();
      Object handback = bean.getHandback();
      ObjectName[] namesToRegisterWith = getObjectNamesForNotificationListener(bean);
      for (int j = 0; j < namesToRegisterWith.length; j++) {
        ObjectName objectName = namesToRegisterWith[j];
        try {
View Full Code Here


    CountingAttributeChangeNotificationListener listener = new CountingAttributeChangeNotificationListener();

    NotificationListenerBean listenerBean = new NotificationListenerBean();
    listenerBean.setNotificationListener(listener);
    listenerBean.setNotificationFilter(new NotificationFilter() {
      public boolean isNotificationEnabled(Notification notification) {
        if (notification instanceof AttributeChangeNotification) {
          AttributeChangeNotification changeNotification = (AttributeChangeNotification) notification;
          return "Name".equals(changeNotification.getAttributeName());
        }
View Full Code Here

            Map map = Collections.singletonMap(JMXConnector.CREDENTIALS, creds);
            JMXConnector connector = JMXConnectorFactory.connect(url, map);
            setServerConnection(connector.getMBeanServerConnection());
        }
        // subscribe
        NotificationFilter nf = ep.getNotificationFilter();

        ObjectName objectName = ep.getJMXObjectName();

        getServerConnection().addNotificationListener(objectName, this, nf, ep.getHandback());
    }
View Full Code Here

        ElementProperty[] properties = null;
        if( filterConfig != null ) {
            filterClassName = filterConfig.getFilterClassName();
            properties = filterConfig.getElementProperty();
        }
        NotificationFilter filter = null;
        try {
            filter = (NotificationFilter) instantiateAndConfigure(
                filterClassName, properties );
        } catch( Exception e ) {
            new ErrorManager().error(
View Full Code Here

        Object result    = null;
        boolean isException = false;

        ObjectName objname1 = (ObjectName) request.getParams()[0];
        ObjectName objname2 = (ObjectName) request.getParams()[1];
        NotificationFilter filter = (NotificationFilter) request.getParams()[2];
        Object handback = request.getParams()[3];
        String lsnrid = (String) request.getParams()[4];

        ListenerInfo info = notifMgr.removeObjNameNotificationListener(objname1, lsnrid);
        if (info == null)
View Full Code Here

        Object result    = null;
        boolean isException = false;

        ObjectName objname1 = (ObjectName) request.getParams()[0];
        ObjectName objname2 = (ObjectName) request.getParams()[1];
        NotificationFilter filter  = (NotificationFilter) request.getParams()[2];
        Object handback = request.getParams()[3];
        String lsnrid = (String) request.getParams()[4];

        notifMgr.addObjNameNotificationListener(objname1, filter, handback, lsnrid);
View Full Code Here

 
      private void
  addListener( final LogMBeanIntf logMBean )
  {
      final MyLogMBeanListener listener = new MyLogMBeanListener();
      final NotificationFilter filter = null;
      logMBean.addNotificationListener( listener, filter, null );
  }
View Full Code Here

     
      for( final ObjectName pattern : mIncludePatterns.keySet() )
      {
        if ( JMXUtil.matchesPattern( defaultDomain, pattern, objectName ) )
        {
          final NotificationFilter  filter  =
            (NotificationFilter)mIncludePatterns.get( pattern );
       
          listenToSingle( objectName, filter );
        }
      }
View Full Code Here

  }
 
    private NotificationFilter
  _getFilter( final ObjectName objectName)
  {
    final NotificationFilter filter  =
      (NotificationFilter)mListenees.get( objectName );
   
    return( filter );
  }
View Full Code Here

        try {
            if (activeRules.containsKey(name)) {
                //remove from the active list and its binding
                ruleInstance = activeRules.remove(name);
                ruleEvent = ruleInstance.getEvent();
                NotificationFilter filter = ruleEvent.getNotificationFilter();
                ObjectName eventObjName = ruleEvent.getObjectName();

                ObjectName actionObjName = (ObjectName)ruleInstance.getAction();
        if(actionObjName != null) {
                    instanceMbs.removeNotificationListener(eventObjName,
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.