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 * The InstallerMBean defines standard installation and uninstallation controls
023 * for components. InstallerMBeans are created by the
024 * {@link InstallationServiceMBean}. The InstallerMBean offers controls to
025 * allow an administrative tool to:
026 * <ul>
027 * <li>Install the component from the installation package.</li>
028 * <li>Uninstall the component.</li>
029 * <li>Check the installation status of the component.</li>
030 * <li>Get the file path to the component's installation root directory.</li>
031 * </ul>
032 *
033 * @author JSR208 Expert Group
034 */
035 public interface InstallerMBean {
036
037 /**
038 * Get the installation root directory path for this component.
039 *
040 * @return the full installation path of this component; this must be in
041 * absolute path name form, in platform-specific format; must be
042 * non-null and non-empty
043 */
044 String getInstallRoot();
045
046 /**
047 * Install a component.
048 * <p>
049 * Note that the implementation must leave the component in its
050 * installed, shutdown state. Automatic starting of components during
051 * installation by implementations is not allowed.
052 *
053 * @return JMX ObjectName representing the LifeCycleMBean for the installed
054 * component, or <code>null</code> if the installation did not
055 * complete
056 * @exception javax.jbi.JBIException if the installation fails
057 */
058 ObjectName install() throws javax.jbi.JBIException;
059
060 /**
061 * Determine whether or not the component is installed.
062 *
063 * @return <code>true</code> if this component is currently installed,
064 * otherwise <code>false</code>
065 */
066 boolean isInstalled();
067
068 /**
069 * Uninstall the component. This completely removes the component from the
070 * JBI system.
071 *
072 * @exception javax.jbi.JBIException if the uninstallation fails
073 */
074 void uninstall() throws javax.jbi.JBIException;
075
076 /**
077 * Get the installer configuration MBean name for this component.
078 *
079 * @return the MBean object name of the Installer Configuration MBean;
080 * <code>null</code> if none is provided by this component
081 * @exception javax.jbi.JBIException if the component is not in the
082 * appropriate state (after install() but before life cycle
083 * initialization), or if any error occurs during processing
084 */
085 ObjectName getInstallerConfigurationMBean() throws javax.jbi.JBIException;
086
087 }