    001    /*****************************************************************************
    002     * Copyright (C) NanoContainer Organization. All rights reserved.            *
    003     * ------------------------------------------------------------------------- *
    004     * The software in this package is published under the terms of the BSD      *
    005     * style license a copy of which has been included with this distribution in *
    006     * the LICENSE.txt file.                                                     *
    007     *                                                                           *
    008     * Original code by Joerg Schaible                                           *
    009     *****************************************************************************/
    010
    011    package org.picocontainer.gems.jmx;
    012
    013    import javax.management.DynamicMBean;
    014    import javax.management.ObjectName;
    015
    016
    017    /**
    018     * Helper class to associate a MBean with an ObjectName.
    019     * @author J&ouml;rg Schaible
    020     */
    021    public class JMXRegistrationInfo {
    022
    023        private final ObjectName objectName;
    024        private final DynamicMBean mBean;
    025
    026        /**
    027         * Construct a JMXRegistrationInfo.
    028         * @param objectName The {@link ObjectName} used for the registration in the {@link javax.management.MBeanServer}.
    029         * @param mBean The {@link DynamicMBean} to register.
    030         */
    031        public JMXRegistrationInfo(final ObjectName objectName, final DynamicMBean mBean) {
    032            this.objectName = objectName;
    033            this.mBean = mBean;
    034        }
    035
    036        /**
    037         * @return Returns the MBean.
    038         */
    039        public DynamicMBean getMBean() {
    040            return mBean;
    041        }
    042
    043        /**
    044         * @return Returns the proposed {@link ObjectName}.
    045         */
    046        public ObjectName getObjectName() {
    047            return objectName;
    048        }
    049    }