Java 8 MBeanServerNotificationFilter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 MBeanServerNotificationFilter class.

This code example shows how to use the following methods:enableAllObjectNames
     * @param pListener listener to register 
     * @param pObjectNameToFilter object name which should be listen for. If null, listens for any MBean registration 
     */ 
    public static void addMBeanRegistrationListener(MBeanServerConnection pServer, NotificationListener pListener,
                                                    ObjectName pObjectNameToFilter) {
        MBeanServerNotificationFilter filter = new MBeanServerNotificationFilter();
        if (pObjectNameToFilter == null) {
            filter.enableAllObjectNames();
        } else { 
            filter.enableObjectName(pObjectNameToFilter);
        } 
        try { 
            pServer.addNotificationListener(getMBeanServerDelegateName(), pListener, filter, null);
        } catch (InstanceNotFoundException e) {
            throw new IllegalStateException("Cannot find " + getMBeanServerDelegateName() + " in server " + pServer,e);
        } catch (IOException e) {
            throw new IllegalStateException("IOException while registering notification listener for " + getMBeanServerDelegateName(),e);
        } 
    } 
 
6
CodeRank
This code example shows how to use the following methods:enableAllObjectNames
This code example shows how to use the following methods:enableAllObjectNames
See Code Examples for Java 8 MBeanServerNotificationFilter Methods: