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
011package org.picocontainer.gems.jmx;
012
013import javax.management.DynamicMBean;
014import javax.management.MalformedObjectNameException;
015import javax.management.ObjectName;
016
017
018/**
019 * Core interface for generating ObjectName instances for a DynamicMBean.
020 * @author Jörg Schaible
021 */
022public interface ObjectNameFactory {
023
024    /**
025     * Create an ObjectName.
026     * @param key The key of the component within PicoContainer.
027     * @param mBean The instance of the DynamicMBean.
028     * @return Returns the Object Name for the DynamicMBean.
029     * @throws MalformedObjectNameException Thrown for an invalid part in the {@link ObjectName}.
030     */
031    ObjectName create(Object key, DynamicMBean mBean) throws MalformedObjectNameException;
032}