001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package javax.jbi.management;
018    
019    import javax.management.ObjectName;
020    
021    /**
022     * This interface provides methods to create JMX object names for component-
023     * supplied MBeans. This ensures that component-supplied MBeans follow the
024     * JBI implementation-determined naming convention.
025     *
026     * Components obtain instances of this name creator using {@link
027     * javax.jbi.component.ComponentContext#getMBeanNames()}.
028     *
029     * @author JSR208 Expert Group
030     */
031    public interface MBeanNames {
032    
033        /** The custom name that must be used for bootstrap extensions */
034        String BOOTSTRAP_EXTENSION = "BootstrapExtension";
035    
036        /** The custom name that must be used for component life cycle extensions */
037        String COMPONENT_LIFE_CYCLE_EXTENSION = "LifeCycleExtension";
038    
039        /**
040         * Formulate and return an MBean ObjectName for a custom control
041         * of this name creator's JBI component.
042         * <p>
043         * This is used by components to create JMX names for their own JMX
044         * controls, allowing the JBI implementation to prefix the created name
045         * to fit within the implementation's own naming scheme.
046         * <p>
047         * Standard extensions must use the following custom name constants:
048         * <ul>
049         *   <li>Bootstrap (installer) extension: {@link #BOOTSTRAP_EXTENSION}.</li>
050         *   <li>Component life cycle extension:
051         *       {@link #COMPONENT_LIFE_CYCLE_EXTENSION}.
052         *   </li>
053         * </ul>
054         * All other custom component MBeans must use custom names that do not
055         * collide with the standard extension names.
056         *
057         * @param customName the name of the custom control; must be non-null and
058         *        non-empty; must be legal for use in a JMX object name
059         * @return the JMX ObjectName of the MBean, or <code>null</code> if
060         *         the <code>customName</code> is invalid
061         */
062        ObjectName createCustomComponentMBeanName(String customName);
063    
064        /**
065         * Retrieve the default JMX Domain Name for MBeans registered in
066         * this instance of the JBI implementation.
067         *
068         * @return the JMX domain name for this instance of the JBI implemention;
069         *         must be non-null and non-empty
070         */
071        String getJmxDomainName();
072    }