001: // Copyright (c) 2004-2005 Sun Microsystems Inc., All Rights Reserved.
002:
003: /*
004: * FileBindingBootstrap.java
005: *
006: * SUN PROPRIETARY/CONFIDENTIAL.
007: * This software is the proprietary information of Sun Microsystems, Inc.
008: * Use is subject to license terms.
009: *
010: */
011: package com.sun.jbi.binding.file;
012:
013: import java.util.logging.Logger;
014:
015: import javax.jbi.component.Bootstrap;
016: import javax.jbi.component.InstallationContext;
017:
018: /**
019: * Implemented by a BC Component (BC) to provide any special processing
020: * required at install/uninstall time. Things such as creation/deletion of
021: * directories, files, database tables could be done by the onInstall() and
022: * onUninstall() methods, respectively. Also allows the BC to terminate the
023: * installation or uninstallation in the event of an error.
024: *
025: * @author Sun Microsystems, Inc.
026: */
027: public class FileBindingBootstrap implements Bootstrap {
028: /**
029: * This is the installation context given by the framework.
030: */
031: private InstallationContext mContext;
032:
033: /**
034: * Internal handle to the logger instance
035: */
036: private Logger mLog;
037:
038: /**
039: * Creates a new instance of FileBindingBootstrap.
040: */
041: public FileBindingBootstrap() {
042: mLog = Logger.getLogger(this .getClass().getPackage().getName());
043: }
044:
045: /**
046: * Get the JMX ObjectName for the optional installation configuration MBean
047: * for this BC. If there is none, the value is null.
048: *
049: * @return ObjectName the JMX object name of the installation configuration
050: * MBean or null if there is no MBean.
051: */
052: public javax.management.ObjectName getExtensionMBeanName() {
053: return null;
054: }
055:
056: /**
057: * Cleans up any resources allocated by the bootstrap implementation,
058: * including deregistration of the extension MBean, if applicable. This
059: * method will be called after the onInstall() or onUninstall() method is
060: * called, whether it succeeds or fails.
061: *
062: * @throws javax.jbi.JBIException when cleanup processing fails to complete
063: * successfully.
064: */
065: public void cleanUp() throws javax.jbi.JBIException {
066: }
067:
068: /**
069: * Called to initialize the BC bootstrap.
070: *
071: * @param installContext is the context containing information from the
072: * install command and from the BC jar file.
073: *
074: * @throws javax.jbi.JBIException when there is an error requiring that the
075: * installation be terminated.
076: */
077: public void init(InstallationContext installContext)
078: throws javax.jbi.JBIException {
079: mContext = installContext;
080:
081: return;
082: }
083:
084: /**
085: * Called at the beginning of installation of File Binding . For this file
086: * binding, all the required installation tasks have been taken care by
087: * the InstallationService.
088: *
089: * @throws javax.jbi.JBIException when there is an error requiring that the
090: * installation be terminated.
091: */
092: public void onInstall() throws javax.jbi.JBIException {
093: mLog.fine("File binding specific installation tasks started");
094:
095: mLog.fine("File binding specific installation tasks ended");
096: }
097:
098: /**
099: * Called at the beginning of uninstallation of FileBinding . For this file
100: * binding, all the required uninstallation tasks have been taken care of
101: * by the InstallationService
102: *
103: * @throws javax.jbi.JBIException when there is an error requiring that the
104: * uninstallation be terminated.
105: */
106: public void onUninstall() throws javax.jbi.JBIException {
107: mLog.fine("File binding specific uninstallation tasks started");
108:
109: mLog.fine("File binding specific uninstallation tasks ended");
110: }
111: }
|