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 Michael Ward                                                 *
009 *****************************************************************************/
010
011package org.picocontainer.gems.jmx;
012
013import javax.management.DynamicMBean;
014import javax.management.MBeanInfo;
015
016
017/**
018 * This factory is responsible for creating instances of DynamicMBean without being dependent on one particular
019 * implementation or external dependency.
020 * @author Michael Ward
021 * @author Jörg Schaible
022 */
023public interface DynamicMBeanFactory {
024
025    /**
026     * Create a DynamicMBean from instance and the provided {@link MBeanInfo}.
027     * @param componentInstance the instance of the Object being exposed for management.
028     * @param management the management interface (can be <code>null</code>).
029     * @param mBeanInfo the explicitly provided management information (can be <code>null</code>).
030     * @return the {@link DynamicMBean}.
031     */
032    public DynamicMBean create(Object componentInstance, Class management, MBeanInfo mBeanInfo);
033}