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 defines a set of administrative methods allowing a JMX-based
023     * administrative tool to perform a variety of administrative tasks.
024     * <ul>
025     *   <li>Find component lifecycle MBean names for:
026     *     <ul>
027     *       <li>Individual components, by name</li>
028     *       <li>All binding components</li>
029     *       <li>All service engines</li>
030     *     </ul>
031     *   </li>
032     *   <li>Find lifecyle MBeans names for implementation-defined services:
033     *     <ul>
034     *       <li>Individual implementation services, by name</li>
035     *       <li>All implementation services</li>
036     *     </ul>
037     *   </li>
038     *   <li>Query whether an individual component is a binding or engine</li>
039     *   <li>Query implementation information (version etc.)</li>
040     * </ul>
041     *
042     * @author JSR208 Expert Group
043     */
044    public interface AdminServiceMBean {
045    
046        /**
047         * Get a list of {@link ComponentLifeCycleMBean}s for all binding components
048         * currently installed in the JBI system.
049         *
050         * @return array of JMX object names of component life cycle MBeans for all
051         *         installed binding components; must be non-null; may be empty
052         */
053        ObjectName[] getBindingComponents();
054    
055        /**
056         * Find the {@link ComponentLifeCycleMBean} of a JBI Installable Component
057         * by its unique name.
058         *
059         * @param name the name of the engine or binding component; must be non-
060         *        null and non-empty
061         * @return the JMX object name of the component's life cycle MBean, or
062         *         <code>null</code> if there is no such component with the given
063         *         <code>name</code>
064         */
065        ObjectName getComponentByName(String name);
066    
067        /**
068         * Get a list of {@link ComponentLifeCycleMBean}s for all service engines
069         * currently installed in the JBI system.
070         *
071         * @return array of JMX object names of component life cycle MBeans for all
072         *         installed service engines; must be non-null; may be empty
073         */
074        ObjectName[] getEngineComponents();
075    
076        /**
077         * Return current version and other info about this JBI implementation. The
078         * contents of the returned string are implementation dependent.
079         *
080         * @return information string about the JBI implementation, including
081         *         version information; must be non-null and non-empty
082         */
083        String getSystemInfo();
084    
085        /**
086         * Lookup a system service {@link LifeCycleMBean} by name. System services
087         * are implementation-defined services which can administered through JMX,
088         * and have a life cycle.
089         * <p>
090         * System services are not related to service engines.
091         *
092         * @param serviceName name of the system service; must be non-null and non-
093         *        empty; values are implementation-dependent
094         * @return JMX object name of the system service's LifeCycleMBean, or
095         *         <code>null</code> if there is no system service with the given
096         *         <code>name</code>.
097         */
098        ObjectName getSystemService(String serviceName);
099    
100        /**
101         * Looks up all JBI system services {@link LifeCycleMBean}'s currently
102         * installed. System services are implementation-defined services which can
103         * administered through JMX. System services are not related to service
104         * engines.
105         *
106         * @return array of LifecycleMBean JMX object names of system services
107         *         currently installed in the JBI implementation; must be non-null;
108         *         may be empty
109         */
110        ObjectName[] getSystemServices();
111    
112        /**
113         * Check if a given JBI component is a Binding Component.
114         *
115         * @param componentName the unique name of the component; must be non-null
116         *        and non-empty
117         * @return <code>true</code> if the component is a binding component;
118         *         <code>false</code> if the component is a service engine or if
119         *         there is no component with the given <code>componentName</code>
120         *         installed in the JBI system
121         */
122        boolean isBinding(String componentName);
123    
124        /**
125         * Check if a given JBI component is a Service Engine.
126         *
127         * @param componentName the unique name of the component; must be non-null
128         *        and non-empty
129         * @return <code>true</code> if the component is a service engine;
130         *         <code>false</code> if the component is a binding component, or if
131         *         there is no component with the given <code>componentName</code>
132         *         installed in the JBI system
133         */
134        boolean isEngine(String componentName);
135    
136    }