Example usage for javax.management ListenerNotFoundException getMessage

List of usage examples for javax.management ListenerNotFoundException getMessage

Introduction

In this page you can find the example usage for javax.management ListenerNotFoundException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.apache.geode.management.internal.beans.DistributedSystemBridge.java

/**
 * Removed the proxy from the map./*from  w  w  w . j  a va2s.  co  m*/
 *
 * @param objectName name of the proxy to be removed.
 * @param proxy actual reference to the proxy object
 * @return whether all proxies have been removed or not. In this case it will always be false.
 *         Kept it for consistency for MBeanAggregator.
 */
public boolean removeMemberFromSystem(ObjectName objectName, MemberMXBean proxy, FederationComponent oldState) {

    if (thisMemberName.equals(objectName)) {
        ObjectName distrObjectName = MBeanJMXAdapter.getDistributedSystemName();
        service.unregisterMBean(distrObjectName);
    }

    if (mapOfMembers != null) {
        mapOfMembers.remove(objectName);
        memberSetSize = mapOfMembers.values().size();
        if (mapOfMembers.values().size() == 0) {
            memberSetSize = 0;
            return true;
        }
    }
    updateMember(objectName, null, oldState);

    try {
        mbeanServer.removeNotificationListener(objectName, distListener);
    } catch (ListenerNotFoundException e) {
        logger.info(LocalizedMessage.create(ManagementStrings.LISTENER_NOT_FOUND_FOR_0, objectName));
        if (logger.isDebugEnabled()) {
            logger.debug(e.getMessage(), e);
        }
    } catch (InstanceNotFoundException e) {
        logger.info(LocalizedMessage.create(ManagementStrings.INSTANCE_NOT_FOUND, objectName));
        if (logger.isDebugEnabled()) {
            logger.debug(e.getMessage(), e);
        }
    }

    return false;
}