Examples of MBeanServerNotification


Examples of javax.management.MBeanServerNotification

      //Should be a mbean registration notification due to RegistrationNotificationFilter being used.
      if (notification instanceof MBeanServerNotification)
      {
         if (notification.getType().equals(MBeanServerNotification.REGISTRATION_NOTIFICATION))
         {
            MBeanServerNotification serverNotification = (MBeanServerNotification) notification;
            try
            {
               mbeanRegistered(serverNotification.getMBeanName());
            }
            catch (Exception e)
            {
               log.error("Error configuring mbean " + serverNotification.getMBeanName(), e);
            }
         }
      }

   }

Examples of javax.management.MBeanServerNotification

      {
         sequenceNumber = notifications;
         ++notifications;
      }

      delegate.sendNotification(new MBeanServerNotification(notificationType, delegateName, sequenceNumber, objectName));
   }

Examples of javax.management.MBeanServerNotification

   
  }
  @Override
  public void handleNotification(Notification notification, Object handback)
  {
    MBeanServerNotification mbs = (MBeanServerNotification) notification;
    if(MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(mbs.getType()))
    {
      //System.out.println("Adding mbean " + mbs.getMBeanName());
      _logger.info("Adding mbean " + mbs.getMBeanName());
      if(mbs.getMBeanName().getDomain().equalsIgnoreCase(_domain))
      {
        addMBean( mbs.getMBeanName());
      }
    }
    else if(MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(mbs.getType()))
    {
      //System.out.println("Removing mbean " + mbs.getMBeanName());
      _logger.info("Removing mbean " + mbs.getMBeanName());
      if(mbs.getMBeanName().getDomain().equalsIgnoreCase(_domain))
      {
        removeMBean(mbs.getMBeanName());
      }
    }
  }

Examples of javax.management.MBeanServerNotification

    _server.addNotificationListener(MBeanServerDelegate.DELEGATE_NAME, this, filter, null);
  }
 
  public void handleNotification(Notification notification, Object handback)
  {
    MBeanServerNotification mbs = (MBeanServerNotification) notification;
    if(MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(mbs.getType()))
    {
      if(mbs.getMBeanName().getDomain().equalsIgnoreCase(_domain))
      {
        _logger.info("MBean Registered, name :" + mbs.getMBeanName());
        onMBeanRegistered(_server, mbs);
      }
    }
    else if(MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(mbs.getType()))
    {
      if(mbs.getMBeanName().getDomain().equalsIgnoreCase(_domain))
      {
        _logger.info("MBean Unregistered, name :" + mbs.getMBeanName());
        onMBeanUnRegistered(_server, mbs);
      }
    }
  }

Examples of javax.management.MBeanServerNotification

    public void handleNotification(Notification notification, Object handback)
    {
        // register/unregister mbeans in jndi
        if( notification instanceof MBeanServerNotification ) {
            MBeanServerNotification msnot=(MBeanServerNotification)notification;

            ObjectName oname=msnot.getMBeanName();

            if( "jmx.mbean.created".equalsIgnoreCase( notification.getType() )) {
                try {
                    Object mbean=mserver.getObjectInstance(oname);

Examples of javax.management.MBeanServerNotification

    public void handleNotification(Notification notification, Object handback)
    {
        // register/unregister mbeans in jndi
        if( notification instanceof MBeanServerNotification ) {
            MBeanServerNotification msnot=(MBeanServerNotification)notification;

            ObjectName oname=msnot.getMBeanName();

            if( "jmx.mbean.created".equalsIgnoreCase( notification.getType() )) {
                try {
                    Object mbean=mserver.getObjectInstance(oname);

Examples of javax.management.MBeanServerNotification

    filter.enableAllObjectNames();
    _server.addNotificationListener(MBeanServerDelegate.DELEGATE_NAME, this, filter, null);
  }

  public void handleNotification(Notification notification, Object handback) {
    MBeanServerNotification mbs = (MBeanServerNotification) notification;
    if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(mbs.getType())) {
      if (mbs.getMBeanName().getDomain().equalsIgnoreCase(_domain)) {
        _logger.info("MBean Registered, name :" + mbs.getMBeanName());
        onMBeanRegistered(_server, mbs);
      }
    } else if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(mbs.getType())) {
      if (mbs.getMBeanName().getDomain().equalsIgnoreCase(_domain)) {
        _logger.info("MBean Unregistered, name :" + mbs.getMBeanName());
        onMBeanUnRegistered(_server, mbs);
      }
    }
  }

Examples of javax.management.MBeanServerNotification

    }
  }

  @Override
  public void handleNotification(Notification notification, Object handback) {
    MBeanServerNotification mbs = (MBeanServerNotification) notification;
    if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(mbs.getType())) {
      // System.out.println("Adding mbean " + mbs.getMBeanName());
      _logger.info("Adding mbean " + mbs.getMBeanName());
      if (mbs.getMBeanName().getDomain().equalsIgnoreCase(_domain)) {
        addMBean(mbs.getMBeanName());
      }
    } else if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(mbs.getType())) {
      // System.out.println("Removing mbean " + mbs.getMBeanName());
      _logger.info("Removing mbean " + mbs.getMBeanName());
      if (mbs.getMBeanName().getDomain().equalsIgnoreCase(_domain)) {
        removeMBean(mbs.getMBeanName());
      }
    }
  }

Examples of javax.management.MBeanServerNotification

    // Check the notification type
    if (super.isNotificationEnabled(notification) == false)
      return false;

    // Get the object name
    MBeanServerNotification mbsNotification = (MBeanServerNotification) notification;
    ObjectName objectName = mbsNotification.getMBeanName();

    // Is it enabled?
    if (enabled != null)
      return enabled.contains(objectName);

Examples of javax.management.MBeanServerNotification

    {
        Object src = notification.getSource();
        ObjectName on = null;
        if (notification instanceof MBeanServerNotification)
        {
            MBeanServerNotification mb = (MBeanServerNotification) notification;
            on = mb.getMBeanName();
        }
        else if (src instanceof ObjectName)
        {
            on = (ObjectName) src;
        }
TOP
Copyright © 2018 www.massapi.com. 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.