Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
PETALS - PETALS Services Platform. Copyright (c) 2007 EBM Websourcing, http://www.ebmwebsourcing.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$ -------------------------------------------------------------------------
 
 
 package org.ow2.petals.component.framework;
 
 import java.io.File;
 
 
 
 import static org.ow2.petals.component.framework.Constants.Component.JBI_XML;
 import static org.ow2.petals.component.framework.Constants.Component.META_INF;

A simple bootstrap implementation. This bootstrap just copy the JBI extensions in a properties file that will be used by components.

Author(s):
ofabre - EBM WebSourcing
chamerling - EBM WebSourcing
rnaudin - EBM WebSourcing
 
 public class Bootstrap implements javax.jbi.component.Bootstrap {
 
     private static final String LOGGER_BOOTSTRAP_PREFIX = "bootstrap.";

    
The component installation context
 
     protected InstallationContext installContext;

    
The logger
 
     private Logger logger;

    
The component configuration
 
     private Jbi jbiComponentConfiguration;

    
Returns null by default as this class does not provides JMX extension MBean

 
     public ObjectName getExtensionMBeanName() {
         return null;
     }

    

Returns:
the componentConfiguration
 
     public Jbi getJbiComponentConfiguration() {
         return this.;
     }

    
 
     public void init(InstallationContext installContextthrows JBIException {
         this. = installContext;
         try {
             // the restriction on the method getLogger has been unactivated in
             // PEtALS container to be able to manage the logger of the bootstrap
             this. = this..getContext().getLogger(
                      + installContext.getComponentName(), null);
         } catch (IllegalStateException e) {
             // not a PEtALS container
            this. = Logger.getLogger(
                    + installContext.getComponentName());
        }
        try {
            // Get the component configuration
            final File jbiXmlFile = new File(installContext.getInstallRoot() + .
                    +  + . + );
            try {
                final FileInputStream jbiInputStream = new FileInputStream(jbiXmlFile);
                try {
                    this. = JBIDescriptorBuilder
                            .buildJavaJBIDescriptor(jbiInputStream);
                } finally {
                    jbiInputStream.close();
                }
            } catch (final CDKJBIDescriptorException e) {
                throw new JBIException(e);
            } catch (final FileNotFoundException e) {
                throw new JBIException(e);
            }
            // do additional configuration from component implementation. (
            // this
            // method is overridden in the default bootstrap)
            doInit();
        } catch (Exception e) {
            throw new JBIException("Initialization exception"e);
        }
    }
    /*
     * (non-Javadoc)
     * 
     * @see javax.jbi.component.Bootstrap#onInstall()
     */
    public void onInstall() throws JBIException {
    }
    /*
     * (non-Javadoc)
     * 
     * @see javax.jbi.component.Bootstrap#onUninstall()
     */
    public void onUninstall() throws JBIException {
    }
    /*
     * (non-Javadoc)
     * 
     * @see javax.jbi.component.Bootstrap#cleanUp()
     */
    public void cleanUp() throws JBIException {
    }
        return ;
    }
    public Logger getLogger() {
        return ;
    }

    
Can be overridden.

    protected void doInit() throws Exception {
    }
New to GrepCode? Check out our FAQ X