Package javax.management.relation

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


      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

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

      }
    }
  }

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

    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

    setUpTest();

    // Enable only one
    mbsnf.enableObjectName(on2);

    MBeanServerNotificationFilter mbsnf2 = null;
    try
    {
      // Serialize it
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(baos);
View Full Code Here

  // Support -------------------------------------------------------------------

  private void setUpTest()
  {
    mbsnf = new MBeanServerNotificationFilter();
    mbsnf.enableType(MBeanServerNotification.REGISTRATION_NOTIFICATION);
    try
    {
      on1 = new ObjectName(":a=a");
      on2 = new ObjectName(":b=b");
View Full Code Here

   protected void onSerialize(SerializationContext context, NotificationFilterSupport filter) throws IOException
   {
      super.onSerialize(context, filter);

      MBeanServerNotificationFilter serverFilter = (MBeanServerNotificationFilter)filter;
      Vector enabledNames = serverFilter.getEnabledObjectNames();
      Vector disabledNames = serverFilter.getDisabledObjectNames();

      // A special logic should be implemented: an empty vector has a different meaning than a null vector
      // See JMX specification (javadocs) for further details
      if (enabledNames != null)
      {
View Full Code Here

      return new InvalidRoleValueException("InvalidRoleValueException");
   }

   public MBeanServerNotificationFilter createMBeanServerNotificationFilter() throws MalformedObjectNameException
   {
      MBeanServerNotificationFilter filter = new MBeanServerNotificationFilter();
      filter.enableType("notif-type");
      filter.disableAllObjectNames();
      filter.enableObjectName(new ObjectName("domain:key=val"));
      return filter;
   }
View Full Code Here

  // Support -------------------------------------------------------------------

  private void setUpTest()
  {
    mbsnf = new MBeanServerNotificationFilter();
    mbsnf.enableType(MBeanServerNotification.REGISTRATION_NOTIFICATION);
    try
    {
      on1 = new ObjectName(":a=a");
      on2 = new ObjectName(":b=b");
View Full Code Here

TOP

Related Classes of javax.management.relation.MBeanServerNotificationFilter

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.