Package javax.management

Examples of javax.management.NotificationListener


   * with the {@link MBeanServer}.
   */
  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];
View Full Code Here


    }
  }

  public void testRegisterNotificationListenerForNonExistentMBean() throws Exception {
    Map listeners = new HashMap();
    NotificationListener dummyListener = new NotificationListener() {
      public void handleNotification(Notification notification, Object handback) {
        throw new UnsupportedOperationException();
      }
    };
    // the MBean with the supplied object name does not exist...
View Full Code Here

        //holders for Notifications captured
        final List<Notification> received = new LinkedList<Notification>();
        final List<AttributeChangeNotification> attributeChanges = new LinkedList<AttributeChangeNotification>();

        //add NotificationListener to receive the events
        bundleState.addNotificationListener(new NotificationListener() {
            public void handleNotification(Notification notification, Object handback) {
                if (notification instanceof AttributeChangeNotification) {
                    attributeChanges.add((AttributeChangeNotification) notification);
                } else {
                    received.add(notification);
View Full Code Here

        //holders for Notifications captured
        final List<Notification> received = new LinkedList<Notification>();
        final List<AttributeChangeNotification> attributeChanges = new LinkedList<AttributeChangeNotification>();

        //add NotificationListener to receive the events
        serviceState.addNotificationListener(new NotificationListener() {
            public void handleNotification(Notification notification, Object handback) {
                if (notification instanceof AttributeChangeNotification) {
                    attributeChanges.add((AttributeChangeNotification) notification);
                } else {
                    received.add(notification);
View Full Code Here

        if( alertLogger.isLoggable( Level.FINE ) ) {
            alertLogger.log( Level.FINE,
             "ConfigureNotificationListener called with className ..." +
             listenerConfig.getListenerClassName( ) );
        }
        NotificationListener listener = null;
        try {
            listener = (NotificationListener) instantiateAndConfigure(
                listenerConfig.getListenerClassName( ),
                    listenerConfig.getElementProperty( ) );
        } catch( Exception e ) {   
View Full Code Here

        ObjectName objname  = (ObjectName) request.getParams()[0];
        String cid = (String) request.getParams()[1];
        String[] ids = (String[]) request.getParams()[2];

        NotificationListener proxy = null;
        try {
            for (int i=0; i < ids.length; i++) {
                proxy = (NotificationListener)
                            notifyMgr.removeNotificationListener(objname, ids[i]);
                mbsc.removeNotificationListener(objname, proxy);
View Full Code Here

        ObjectName objname  = (ObjectName) request.getParams()[0];
        String cid = (String) request.getParams()[1];
        String id = (String) request.getParams()[2];

        if (id != null) {
            NotificationListener proxy =
                    (NotificationListener) notifyMgr.removeNotificationListener(objname, id);
            try {
                mbsc.removeNotificationListener(objname, proxy);
            } catch (Exception e) {
                result = e;
View Full Code Here

      throws Exception
  {
      final long  start   = now();
      final Set<AMX>  all = getAllAMX();
     
      final NotificationListener  listener1    = new DummyListener();
      final NotificationListener  listener2    = new DummyListener();
     
      final NotificationFilter    filter  = new NotificationFilterSupport();
      final Object    handback    = "handback";
     
      for( final AMX amx : all )
View Full Code Here

    }

 
    private void createLoggingListener (Event event, Object handback)
    throws InstanceNotFoundException{
  NotificationListener logListener = LogMgmtEventsNotificationListener.getInstance();
  instanceMbs.addNotificationListener (event.getObjectName(), logListener, event.getNotificationFilter(), handback);
  return;
    }
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

TOP

Related Classes of javax.management.NotificationListener

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.