javax.jbi.component.Bootstrap Maven / Gradle / Ivy
Show all versions of petals-jbi Show documentation
/**
* @(#) Bootstrap.java
*
* PETALS - PETALS Services Platform.
* Copyright (c) 2005 Fossil E-Commerce, http://www.fossilec.com/
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* -------------------------------------------------------------------------
* $Id: Bootstrap.java 69 2006-01-17 16:00:26Z rmarins $
* -------------------------------------------------------------------------
*/
/** $Id: Bootstrap.java 69 2006-01-17 16:00:26Z rmarins $ **/
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.jbi.component;
/**
* This interface is implemented by a JBI Component to provide any special
* processing required at install/uninstall time. The methods defined here are
* called by the JBI implementation during the installation (or uninstallation)
* of the component that, among other things, supplies an implementation of this
* interface.
*
* Initialization/cleanup tasks such as creation/deletion of directories, files,
* and database tables can be done by the {@link Bootstrap#onInstall()} and
* {@link Bootstrap#onUninstall()} methods, respectively. This also allows the
* component to terminate the installation or uninstallation in the event of an
* error.
*
* After calling {@link Bootstrap#onInstall()} or
* {@link Bootstrap#onUninstall()}, regardless of outcome, the JBI
* implementation must call the {@link Bootstrap#cleanUp()} method afterwards.
* Similarly, if {@link Bootstrap#init(InstallationContext)} fails with an
* exception, the JBI implementation must call the {@link Bootstrap#cleanUp()}
* method.
*
* Component implementors should note that there is no guarantee that the same
* instance of its Bootstrap
implementation will be used during both install and
* uninstall operations on the component. Data that need to be retained between
* installation-time and uninstallation-time must be persisted in such as
* fashion that a separate instance of the bootstrap class can find them,
* despite component or system shutdown.
*
* @author JSR208 Expert Group
*/
public interface Bootstrap {
/**
* Cleans up any resources allocated by the bootstrap implementation,
* including performing deregistration of the extension MBean, if
* applicable.
*
* This method must be called after the onInstall() or onUninstall() method
* is called, whether it succeeds or fails. It must be called after init()
* is called, if init() fails by throwing an exception.
*
* @throws javax.jbi.JBIException
* if the bootstrap cannot clean up allocated resources.
*/
public void cleanUp() throws javax.jbi.JBIException;
/**
* Obtains the ObjectName
of the optional installer
* configuration MBean. If none is provided by this component, this method
* must return null
.
*
* This method must be called before onInstall() (or onUninstall()) is
* called by the JBI implementation.
*
* @return ObjectName of the optional installer configuration MBean; returns
* null
if there is no such MBean.
*/
public javax.management.ObjectName getExtensionMBeanName();
/**
* Initializes the installation environment for a component. This method is
* expected to save any information from the installation context that may
* be needed by other methods.
*
* If the component needs to register an optional installer configuration
* MBean, it MUST do so during execution of this method, or the
* getExtensionMBean() method.
*
* This method must be called after the installation root (available through
* the installContext parameter) is prepared.
*
* @param installContext
* the context containing information from the install command
* and from the component installation ZIP file; this must be
* non-null.
* @throws javax.jbi.JBIException
* when there is an error requiring that the installation be
* terminated.
*/
public void init(javax.jbi.component.InstallationContext installContext)
throws javax.jbi.JBIException;
/**
* Called at the beginning of installation of a component to perform any
* special installation tasks required by the component.
*
* This method must not be called if the init() method failed with an
* exception.
*
* @throws javax.jbi.JBIException
* when there is an error requiring that the installation be
* terminated.
*/
public void onInstall() throws javax.jbi.JBIException;
/**
* Called at the beginning of uninstallation of a component to perform any
* special uninstallation tasks required by the component.
*
* This method must not be called if the init() method failed with an
* exception.
*
* @throws javax.jbi.JBIException
* when there is an error requiring that the uninstallation be
* terminated.
*/
public void onUninstall() throws javax.jbi.JBIException;
}