Package javax.management

Examples of javax.management.MBeanServerNotification


      if (goOn)
      {
         if (notification instanceof MBeanServerNotification)
         {
            MBeanServerNotification n = (MBeanServerNotification)notification;
            ObjectName name = n.getMBeanName();

            if (m_enabledObjectNames == null)
            {
               // All enabled, check the disabled ones
               if (m_disabledObjectNames != null && m_disabledObjectNames.contains(name))


      return new MBeanServerDelegate();
   }

   public MBeanServerNotification createMBeanServerNotification() throws MalformedObjectNameException
   {
      MBeanServerNotification n = new MBeanServerNotification(MBeanServerNotification.REGISTRATION_NOTIFICATION, "notif-source", 13L, new ObjectName(":key=value"));
      n.setUserData("user-data");
      return n;
   }

                    "Type not selected, exiting");
            return false;
        }

        // We have a MBeanServerNotification: downcasts it
        MBeanServerNotification mbsNtf = (MBeanServerNotification)notif;

        // Checks the ObjectName
        ObjectName objName = mbsNtf.getMBeanName();
        // Is it selected?
        boolean isSelectedFlg = false;
        if (selectedNames != null) {
            // Not all are implicitly selected:
            // checks for explicit selection

        RELATION_LOGGER.entering(RelationService.class.getName(),
                "handleNotification", notif);

        if (notif instanceof MBeanServerNotification) {

            MBeanServerNotification mbsNtf = (MBeanServerNotification) notif;
            String ntfType = notif.getType();

            if (ntfType.equals(
                       MBeanServerNotification.UNREGISTRATION_NOTIFICATION )) {
                ObjectName mbeanName =

   public boolean isNotificationEnabled(Notification notification)
   {
      if(notification instanceof MBeanServerNotification)
      {
         MBeanServerNotification n = (MBeanServerNotification) notification;
         ObjectName mbean = n.getMBeanName();
         // find the server using the server id
         List list = MBeanServerFactory.findMBeanServer(serverId);
         if(list.isEmpty() == false)
         {
            MBeanServer server = (MBeanServer) list.get(0);

      }
      try
      {
         if(notification instanceof MBeanServerNotification && JMXUtil.getMBeanServerObjectName().equals(notification.getSource()))
         {
            MBeanServerNotification n = (MBeanServerNotification) notification;
            String type = n.getType();
            ObjectName mbean = n.getMBeanName();
            if(type.equals(MBeanServerNotification.REGISTRATION_NOTIFICATION))
            {
               addMBean((MBeanServerLocator) o, mbean);
            }
            else

                        final String unreg =
                            MBeanServerNotification.UNREGISTRATION_NOTIFICATION;
                        if (notif instanceof MBeanServerNotification &&
                            notif.getType().equals(unreg)) {

                            MBeanServerNotification mbsn =
                                (MBeanServerNotification) notif;
                            ObjectName name = mbsn.getMBeanName();

                            removeNotificationListener(name);
                        }
                    }
                    myListenerID = mbeanRemovedNotifID;

                if (idaf.id == id) {
                    // This is a notification from the MBeanServerDelegate.
                    Notification n = tn.getNotification();
                    if (n instanceof MBeanServerNotification &&
                            n.getType().equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) {
                        MBeanServerNotification mbsn = (MBeanServerNotification) n;
                        ObjectName gone = mbsn.getMBeanName();
                        synchronized (listenerMap) {
                            listenerMap.remove(gone);
                        }
                    }
                }

        // ------------------------------

        // ---------------------
        // Create notification
        // ---------------------
        MBeanServerNotification notif = new MBeanServerNotification(
            NotifType,MBeanServerDelegate.DELEGATE_NAME,0,name);

        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
            MBEANSERVER_LOGGER.logp(Level.FINER,
                    DefaultMBeanServerInterceptor.class.getName(),

    }
    catch (Exception e)
    {
      fail(e.toString());
    }
    n1 = new MBeanServerNotification(MBeanServerNotification.REGISTRATION_NOTIFICATION,
                                     new Object(), 1, on1);
    n2 = new MBeanServerNotification(MBeanServerNotification.REGISTRATION_NOTIFICATION,
                                     new Object(), 2, on2);
  }

TOP

Related Classes of javax.management.MBeanServerNotification

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.