Examples of MBeanServerNotificationFilter


Examples of javax.management.relation.MBeanServerNotificationFilter

   
    JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + _jmxUrl + "/jmxrmi");
    JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
   
    _mbeanServer = jmxc.getMBeanServerConnection();
    MBeanServerNotificationFilter filter = new MBeanServerNotificationFilter();
    filter.enableAllObjectNames();
    _mbeanServer.addNotificationListener(MBeanServerDelegate.DELEGATE_NAME, this, filter, null);
    init();
    _timer = new Timer(true);
    _timer.scheduleAtFixedRate(new SampleTask(), _samplePeriod, _samplePeriod);
  }
View Full Code Here

Examples of javax.management.relation.MBeanServerNotificationFilter

      throws InstanceNotFoundException, IOException, MalformedObjectNameException, NullPointerException
  {
    // Get a reference to the target MBeanServer
    _domain = domain;
    _server = ManagementFactory.getPlatformMBeanServer();
    MBeanServerNotificationFilter filter = new MBeanServerNotificationFilter();
    filter.enableAllObjectNames();
    _server.addNotificationListener(MBeanServerDelegate.DELEGATE_NAME, this, filter, null);
  }
View Full Code Here

Examples of javax.management.relation.MBeanServerNotificationFilter

    }
  }
 
  public void disconnect()
  {
    MBeanServerNotificationFilter filter = new MBeanServerNotificationFilter();
    try
    {
      _server.removeNotificationListener(MBeanServerDelegate.DELEGATE_NAME, this);
    }
    catch (Exception e)
View Full Code Here

Examples of javax.management.relation.MBeanServerNotificationFilter

      throws InstanceNotFoundException, IOException, MalformedObjectNameException, NullPointerException
  {
    // Get a reference to the target MBeanServer
    _domain = domain;
    _server = ManagementFactory.getPlatformMBeanServer();
    MBeanServerNotificationFilter filter = new MBeanServerNotificationFilter();
    filter.enableAllObjectNames();
    _server.addNotificationListener(MBeanServerDelegate.DELEGATE_NAME, this, filter, null);
  }
View Full Code Here

Examples of javax.management.relation.MBeanServerNotificationFilter

    }
  }
 
  public void disconnect()
  {
    MBeanServerNotificationFilter filter = new MBeanServerNotificationFilter();
    try
    {
      _server.removeNotificationListener(MBeanServerDelegate.DELEGATE_NAME, this);
    }
    catch (Exception e)
View Full Code Here

Examples of javax.management.relation.MBeanServerNotificationFilter

/*     */   public static final String ENABLE_OBJECTNAME_ATTRIBUTE = "object-name";
/*     */
/*     */   public NotificationFilter createNotificationFilter(Element filterConfig)
/*     */     throws Exception
/*     */   {
/*  88 */     MBeanServerNotificationFilter filter = new MBeanServerNotificationFilter();
/*     */
/*  92 */     NodeList filterChildren = filterConfig.getChildNodes();
/*     */
/*  94 */     for (int i = 0; i < filterChildren.getLength(); i++)
/*     */     {
/*  96 */       Node filterChildNode = filterChildren.item(i);
/*     */
/*  99 */       if (!filterChildNode.getNodeName().equals("enable")) {
/*     */         continue;
/*     */       }
/* 102 */       if (((Element)filterChildNode).hasAttribute("type"))
/*     */       {
/* 104 */         String type = ((Element)filterChildNode).getAttribute("type");
/*     */
/* 106 */         filter.enableType(type);
/*     */       }
/* 108 */       else if (((Element)filterChildNode).hasAttribute("object-name"))
/*     */       {
/* 110 */         String objectName = ((Element)filterChildNode).getAttribute("object-name");
/*     */
/* 113 */         filter.enableObjectName(new ObjectName(objectName));
/*     */       }
/*     */       else
/*     */       {
/* 117 */         throw new Exception("'enable' element must have a 'type' or a 'object-name' attribute");
/*     */       }
View Full Code Here
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.