Package org.apache.fulcrum.yaafi.framework.factory

Examples of org.apache.fulcrum.yaafi.framework.factory.ServiceContainerConfiguration


     */
    public YAAFIContainer()
    {
        // org.apache.log4j.BasicConfigurator.configure();
        this.enableLogging( new ConsoleLogger( ConsoleLogger.LEVEL_DEBUG ) );
        this.config = new ServiceContainerConfiguration();
    }
View Full Code Here


        this.logger.info("Using the following home : "
                + home.getAbsolutePath());

        // create the configuration for YAAFI
        ServiceContainerConfiguration config = this
                .createServiceContainerConfiguration(conf,
                        home.getAbsolutePath());

        try
        {
View Full Code Here

     * @throws IOException creating the YAAFI configuration failed
     */
    protected ServiceContainerConfiguration createServiceContainerConfiguration(
            Configuration conf, String appRoot) throws IOException
    {
        ServiceContainerConfiguration result
                = new ServiceContainerConfiguration();

        result.setLogger(this.createAvalonLogger(AVALON_LOG_CATEGORY));
        result.setApplicationRootDir(appRoot);

        // are we using a "containerConfiguration.xml" ?!

        if (conf.containsKey(CONTAINER_CONFIGURATION_KEY))
        {
            // determine the container configuration file

            String containerConfiguration
                    = conf.getString(CONTAINER_CONFIGURATION_KEY);

            result.loadContainerConfiguration(containerConfiguration);
        }
        else if (conf.containsKey(COMPONENT_ROLE_KEY))
        {
            // determine the location of the role configuration file

            String roleConfigurationFileName
                    = conf.getString(COMPONENT_ROLE_KEY, COMPONENT_ROLE_VALUE);

            // determine the location of component configuration file

            String componentConfigurationFileName = conf.getString(
                    COMPONENT_CONFIG_KEY, COMPONENT_CONFIG_VALUE);

            // determine the location of parameters file

            String parametersFileName = conf.getString(
                    COMPONENT_PARAMETERS_KEY, COMPONENT_PARAMETERS_VALUE);

            result.setComponentRolesLocation(roleConfigurationFileName);
            result.setComponentConfigurationLocation(
                    componentConfigurationFileName);
            result.setParametersLocation(parametersFileName);
        }
        else
        {
            // determine the container configuration file

            String containerConfiguration = conf.getString(
                    CONTAINER_CONFIGURATION_KEY, CONTAINER_CONFIGURATION_VALUE);

            result.loadContainerConfiguration(containerConfiguration);
        }

        return result;
    }
View Full Code Here

     * @see org.apache.avalon.framework.activity.Initializable#initialize()
     * @throws Exception the initialization failed
     */
    public void initialize() throws Exception
    {
        ServiceContainerConfiguration config = new ServiceContainerConfiguration();

        // wrap Spring's BeanFactory to allow service lookups
        BeanFactoryServiceManager beanFactoryServiceManager = new BeanFactoryServiceManager(this.getBeanFactory());

        // intialize the Avalon serviceContainer
        config.setLogger( this.getLogger() );
        config.setApplicationRootDir( this.getApplicationHome() );
        config.setTempRootDir( this.getTempHome() );
        config.loadContainerConfiguration( this.getContainerConfigValue(), "auto" );
        config.setParentServiceManager(beanFactoryServiceManager);
        config.setContext(new DefaultContext(this.getDefaultContext()));

        this.setServiceManager(ServiceContainerFactory.create(config));
    }
View Full Code Here

     * @see junit.framework.TestCase#setUp()
     */
    protected void setUp() throws Exception
    {
        super.setUp();
        ServiceContainerConfiguration config = new ServiceContainerConfiguration();
        config.loadContainerConfiguration( "./src/test/springIntoAvalonContainerConfiguration.xml" );
        this.container = ServiceContainerFactory.create( config );
    }
View Full Code Here

     */
    public YAAFIContainer()
    {
        // org.apache.log4j.BasicConfigurator.configure();
        this.enableLogging( new ConsoleLogger( ConsoleLogger.LEVEL_DEBUG ) );
        this.config = new ServiceContainerConfiguration();
    }
View Full Code Here

     */
    public void initialize() throws Exception
    {
        this.getLogger().debug( "Initializing " + this.getClass().getName() );

        ServiceContainerConfiguration config = new ServiceContainerConfiguration();

        // intialize the Avalon container

        config.setLogger( this.getLogger() );
        config.setApplicationRootDir( this.getApplicationHome() );
        config.setTempRootDir( this.getTempHome() );
        config.loadContainerConfiguration( this.getContainerConfigValue(), "auto" );

        this.container = ServiceContainerFactory.create( config );

        // initialize shutdown hook of JVM for a server application

View Full Code Here

        String homePath = Turbine.getRealPath("/");
        log.info( "Using the following home : " + homePath );

        // create the configuration for YAAFI

        ServiceContainerConfiguration config =
            this.createServiceContainerConfiguration(conf);

        config.setLogger( this.createAvalonLogger() );
        config.setApplicationRootDir( homePath );

        // initialize the container

        try
        {
View Full Code Here

     * @throws IOException creating the YAAFI configuration failed
     */
    protected ServiceContainerConfiguration createServiceContainerConfiguration( Configuration conf )
        throws IOException
    {
        ServiceContainerConfiguration result = new ServiceContainerConfiguration();

        // are we using a "containerConfiguration.xml" ?!

        if( conf.containsKey(CONTAINER_CONFIGURATION_KEY) )
        {
            // determine the container configuration file

            String containerConfiguration = conf.getString(
                CONTAINER_CONFIGURATION_KEY
                );

            result.loadContainerConfiguration(containerConfiguration);
        }
        else if( conf.containsKey(COMPONENT_ROLE_KEY) )
        {
            // determine the location of the role configuraton file

            String roleConfigurationFileName = conf.getString(
                COMPONENT_ROLE_KEY,
                COMPONENT_ROLE_VALUE
                );

            // determine the location of component configuration file

            String componentConfigurationFileName = conf.getString(
                COMPONENT_CONFIG_KEY,
                COMPONENT_CONFIG_VALUE
                );

            // determine the location of parameters file

            String parametersFileName = conf.getString(
                COMPONENT_PARAMETERS_KEY,
                COMPONENT_PARAMETERS_VALUE
                );

            result.setComponentRolesLocation( roleConfigurationFileName );
            result.setComponentConfigurationLocation( componentConfigurationFileName );
            result.setParametersLocation( parametersFileName );
        }
        else
        {
            // determine the container configuration file

            String containerConfiguration = conf.getString(
                CONTAINER_CONFIGURATION_KEY,
                CONTAINER_CONFIGURATION_VALUE
                );

            result.loadContainerConfiguration(containerConfiguration);
        }

        return result;
    }
View Full Code Here

     */
    public Container()
    {
        // org.apache.log4j.BasicConfigurator.configure();
        this.enableLogging( new ConsoleLogger( ConsoleLogger.LEVEL_DEBUG ) );
        this.config = new ServiceContainerConfiguration();
    }
View Full Code Here

TOP

Related Classes of org.apache.fulcrum.yaafi.framework.factory.ServiceContainerConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.