jmx/jmx-blueprint-core/src/main/java/org/apache/aries/jmx/blueprint/impl/RegistrableStandardEmitterMBean.java [28:139]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class RegistrableStandardEmitterMBean extends StandardMBean implements MBeanRegistration, NotificationEmitter {

    public <T> RegistrableStandardEmitterMBean(T impl, Class<T> intf) throws NotCompliantMBeanException {
        super(impl, intf);
    }

    /**
     * @see javax.management.StandardMBean#getMBeanInfo()
     */
    public MBeanInfo getMBeanInfo() {
        MBeanInfo mbeanInfo = super.getMBeanInfo();
        if (mbeanInfo != null) {
            MBeanNotificationInfo[] notificationInfo;
            Object impl = getImplementation();
            if (impl instanceof NotificationEmitter) {
                notificationInfo = ((NotificationEmitter) (impl)).getNotificationInfo();
            } else {
                notificationInfo = new MBeanNotificationInfo[0];
            }
            mbeanInfo = new MBeanInfo(mbeanInfo.getClassName(), mbeanInfo.getDescription(), mbeanInfo.getAttributes(),
                    mbeanInfo.getConstructors(), mbeanInfo.getOperations(), notificationInfo);
        }
        return mbeanInfo;
    }

    /**
     * @see javax.management.MBeanRegistration#postDeregister()
     */
    public void postDeregister() {
        Object impl = getImplementation();
        if (impl instanceof MBeanRegistration) {
            ((MBeanRegistration) impl).postDeregister();
        }
    }

    /**
     * @see javax.management.MBeanRegistration#postRegister(Boolean)
     */
    public void postRegister(Boolean registrationDone) {
        Object impl = getImplementation();
        if (impl instanceof MBeanRegistration) {
            ((MBeanRegistration) impl).postRegister(registrationDone);
        }
    }

    /**
     * @see javax.management.MBeanRegistration#preDeregister()
     */
    public void preDeregister() throws Exception {
        Object impl = getImplementation();
        if (impl instanceof MBeanRegistration) {
            ((MBeanRegistration) impl).preDeregister();
        }
    }

    /**
     * @see javax.management.MBeanRegistration#preRegister(javax.management.MBeanServer, javax.management.ObjectName)
     */
    public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception {
        ObjectName result = name;
        Object impl = getImplementation();
        if (impl instanceof MBeanRegistration) {
            result = ((MBeanRegistration) impl).preRegister(server, name);
        }
        return result;
    }

    /**
     * @see javax.management.NotificationEmitter#removeNotificationListener(javax.management.NotificationListener,
     *      javax.management.NotificationFilter, Object)
     */
    public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
            throws ListenerNotFoundException {
        Object impl = getImplementation();
        if (impl instanceof NotificationEmitter) {
            ((NotificationEmitter) (impl)).removeNotificationListener(listener, filter, handback);
        }
    }

    /**
     * @see javax.management.NotificationBroadcaster#addNotificationListener(javax.management.NotificationListener,
     *      javax.management.NotificationFilter, Object)
     */
    public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
            throws IllegalArgumentException {
        Object impl = getImplementation();
        if (impl instanceof NotificationEmitter) {
            ((NotificationEmitter) (impl)).addNotificationListener(listener, filter, handback);
        }
    }

    /**
     * @see javax.management.NotificationBroadcaster#getNotificationInfo()
     */
    public MBeanNotificationInfo[] getNotificationInfo() {
        MBeanNotificationInfo[] result;
        Object impl = getImplementation();
        if (impl instanceof NotificationEmitter) {
            result = ((NotificationEmitter) (impl)).getNotificationInfo();
        } else {
            result = new MBeanNotificationInfo[0];
        }
        return result;
    }

    /**
     * @see javax.management.NotificationBroadcaster#removeNotificationListener(javax.management.NotificationListener)
     */
    public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException {
        Object impl = getImplementation();
        if (impl instanceof NotificationEmitter) {
            ((NotificationEmitter) (impl)).removeNotificationListener(listener);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



jmx/jmx-core/src/main/java/org/apache/aries/jmx/util/shared/RegistrableStandardEmitterMBean.java [38:149]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class RegistrableStandardEmitterMBean extends StandardMBean implements MBeanRegistration, NotificationEmitter {

    public <T> RegistrableStandardEmitterMBean(T impl, Class<T> intf) throws NotCompliantMBeanException {
        super(impl, intf);
    }

    /**
     * @see javax.management.StandardMBean#getMBeanInfo()
     */
    public MBeanInfo getMBeanInfo() {
        MBeanInfo mbeanInfo = super.getMBeanInfo();
        if (mbeanInfo != null) {
            MBeanNotificationInfo[] notificationInfo;
            Object impl = getImplementation();
            if (impl instanceof NotificationEmitter) {
                notificationInfo = ((NotificationEmitter) (impl)).getNotificationInfo();
            } else {
                notificationInfo = new MBeanNotificationInfo[0];
            }
            mbeanInfo = new MBeanInfo(mbeanInfo.getClassName(), mbeanInfo.getDescription(), mbeanInfo.getAttributes(),
                    mbeanInfo.getConstructors(), mbeanInfo.getOperations(), notificationInfo);
        }
        return mbeanInfo;
    }

    /**
     * @see javax.management.MBeanRegistration#postDeregister()
     */
    public void postDeregister() {
        Object impl = getImplementation();
        if (impl instanceof MBeanRegistration) {
            ((MBeanRegistration) impl).postDeregister();
        }
    }

    /**
     * @see javax.management.MBeanRegistration#postRegister(java.lang.Boolean)
     */
    public void postRegister(Boolean registrationDone) {
        Object impl = getImplementation();
        if (impl instanceof MBeanRegistration) {
            ((MBeanRegistration) impl).postRegister(registrationDone);
        }
    }

    /**
     * @see javax.management.MBeanRegistration#preDeregister()
     */
    public void preDeregister() throws Exception {
        Object impl = getImplementation();
        if (impl instanceof MBeanRegistration) {
            ((MBeanRegistration) impl).preDeregister();
        }
    }

    /**
     * @see javax.management.MBeanRegistration#preRegister(javax.management.MBeanServer, javax.management.ObjectName)
     */
    public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception {
        ObjectName result = name;
        Object impl = getImplementation();
        if (impl instanceof MBeanRegistration) {
            result = ((MBeanRegistration) impl).preRegister(server, name);
        }
        return result;
    }

    /**
     * @see javax.management.NotificationEmitter#removeNotificationListener(javax.management.NotificationListener,
     *      javax.management.NotificationFilter, java.lang.Object)
     */
    public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
            throws ListenerNotFoundException {
        Object impl = getImplementation();
        if (impl instanceof NotificationEmitter) {
            ((NotificationEmitter) (impl)).removeNotificationListener(listener, filter, handback);
        }
    }

    /**
     * @see javax.management.NotificationBroadcaster#addNotificationListener(javax.management.NotificationListener,
     *      javax.management.NotificationFilter, java.lang.Object)
     */
    public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
            throws IllegalArgumentException {
        Object impl = getImplementation();
        if (impl instanceof NotificationEmitter) {
            ((NotificationEmitter) (impl)).addNotificationListener(listener, filter, handback);
        }
    }

    /**
     * @see javax.management.NotificationBroadcaster#getNotificationInfo()
     */
    public MBeanNotificationInfo[] getNotificationInfo() {
        MBeanNotificationInfo[] result;
        Object impl = getImplementation();
        if (impl instanceof NotificationEmitter) {
            result = ((NotificationEmitter) (impl)).getNotificationInfo();
        } else {
            result = new MBeanNotificationInfo[0];
        }
        return result;
    }

    /**
     * @see javax.management.NotificationBroadcaster#removeNotificationListener(javax.management.NotificationListener)
     */
    public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException {
        Object impl = getImplementation();
        if (impl instanceof NotificationEmitter) {
            ((NotificationEmitter) (impl)).removeNotificationListener(listener);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



