Return-Path: Delivered-To: apmail-avalon-cvs-archive@avalon.apache.org Received: (qmail 83136 invoked by uid 500); 19 Aug 2003 03:51:06 -0000 Mailing-List: contact cvs-help@avalon.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list cvs@avalon.apache.org Received: (qmail 83080 invoked by uid 500); 19 Aug 2003 03:51:05 -0000 Received: (qmail 83067 invoked from network); 19 Aug 2003 03:51:05 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 19 Aug 2003 03:51:05 -0000 Received: (qmail 24363 invoked by uid 1438); 19 Aug 2003 03:51:24 -0000 Date: 19 Aug 2003 03:51:24 -0000 Message-ID: <20030819035124.24362.qmail@minotaur.apache.org> From: mcconnell@apache.org To: avalon-sandbox-cvs@apache.org Subject: cvs commit: avalon-sandbox/merlin/merlin-platform/tutorials/mixed/src/java/tutorial HelloComponent.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N mcconnell 2003/08/18 20:51:24 Modified: merlin maven.xml merlin/activation project.xml merlin/activation/src/java/org/apache/avalon/activation/appliance/impl DefaultAppliance.java Resources.properties merlin/activation/src/test/org/apache/avalon/activation/appliance AbstractTestCase.java merlin/activation-spi project.xml merlin/composition/src/java/org/apache/avalon/composition/data/builder XMLDeploymentProfileCreator.java merlin/composition/src/java/org/apache/avalon/composition/model/impl DefaultSystemContext.java merlin/composition-spi/src/java/org/apache/avalon/composition/model SystemContext.java merlin/kernel/bootstrap/src/etc merlin.properties merlin/kernel/impl project.xml merlin/kernel/spi project.xml merlin/merlin-platform project.xml merlin/merlin-platform/tutorials/context_casting/src/java/tutorial HelloComponent.java merlin/merlin-platform/tutorials/context_standard/src/java/tutorial HelloComponent.java merlin/merlin-platform/tutorials/contextualization .cvsignore project.xml merlin/merlin-platform/tutorials/contextualization/src/java/tutorial StandardComponent.java merlin/merlin-platform/tutorials/mixed/src/java/tutorial HelloComponent.java Added: merlin/activation-api/src/java/org/apache/avalon/activation/appliance DuplicateApplianceException.java merlin/activation-api/src/java/org/apache/avalon/activation/lifecycle LifestyleException.java LifestyleRuntimeException.java merlin/activation-api/src/java/org/apache/avalon/activation/lifestyle LifestyleException.java LifestyleRuntimeException.java package.html Removed: merlin/activation-spi/src/java/org/apache/avalon/activation/appliance ApplianceEvent.java ApplianceException.java ApplianceListener.java ApplianceRuntimeException.java AssemblyException.java CascadingIOException.java DeploymentException.java DuplicateApplianceException.java Home.java NoProviderDefinitionException.java UnknownServiceException.java merlin/activation-spi/src/java/org/apache/avalon/activation/lifecycle ContextualizationHandler.java LifecycleException.java LifecycleRuntimeException.java merlin/activation-spi/src/java/org/apache/avalon/activation/lifestyle LifestyleException.java LifestyleRuntimeException.java Log: Updates relative to API/SPI seperation in activation package and updates to tutorials to reflect 3.0 classloading management. Revision Changes Path 1.36 +1 -0 avalon-sandbox/merlin/maven.xml Index: maven.xml =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/maven.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- maven.xml 12 Aug 2003 05:30:44 -0000 1.35 +++ maven.xml 19 Aug 2003 03:51:22 -0000 1.36 @@ -215,6 +215,7 @@ + 1.4 +5 -0 avalon-sandbox/merlin/activation/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/activation/project.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- project.xml 12 Aug 2003 16:12:32 -0000 1.3 +++ project.xml 19 Aug 2003 03:51:23 -0000 1.4 @@ -31,6 +31,11 @@ avalon-activation + avalon-activation-api + SNAPSHOT + + + avalon-activation avalon-activation-spi SNAPSHOT 1.5 +60 -1 avalon-sandbox/merlin/activation/src/java/org/apache/avalon/activation/appliance/impl/DefaultAppliance.java Index: DefaultAppliance.java =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/activation/src/java/org/apache/avalon/activation/appliance/impl/DefaultAppliance.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- DefaultAppliance.java 18 Aug 2003 17:02:37 -0000 1.4 +++ DefaultAppliance.java 19 Aug 2003 03:51:23 -0000 1.5 @@ -626,6 +626,7 @@ int id = System.identityHashCode( instance ); getLogger().debug( "new instance: " + id ); } + applyLogger( instance ); applyContext( instance ); applyServices( instance ); @@ -634,6 +635,13 @@ applyCreateStages( instance, true ); applyInitialization( instance ); applyStart( instance ); + + if( getLogger().isDebugEnabled() ) + { + int id = System.identityHashCode( instance ); + getLogger().debug( "component established: " + id ); + } + return instance; } catch( Throwable e ) @@ -698,6 +706,11 @@ { if( instance instanceof LogEnabled ) { + if( getLogger().isDebugEnabled() ) + { + int id = System.identityHashCode( instance ); + getLogger().debug( "applying logger to: " + id ); + } ((LogEnabled)instance).enableLogging( getLogger() ); } } @@ -714,6 +727,11 @@ Context context = model.getContext(); if( m_contextualization != null ) { + if( getLogger().isDebugEnabled() ) + { + int id = System.identityHashCode( instance ); + getLogger().debug( "applying contextualization strategy to: " + id ); + } try { m_contextualization.contextualize( instance, context ); @@ -729,6 +747,12 @@ } else if( instance instanceof Contextualizable ) { + if( getLogger().isDebugEnabled() ) + { + int id = System.identityHashCode( instance ); + getLogger().debug( "applying contextualization to: " + id ); + } + try { ((Contextualizable)instance).contextualize( context ); @@ -749,6 +773,11 @@ { if( instance instanceof Serviceable ) { + if( getLogger().isDebugEnabled() ) + { + int id = System.identityHashCode( instance ); + getLogger().debug( "applying service manager to: " + id ); + } ServiceManager manager = new DefaultServiceManager( m_providers ); ((Serviceable)instance).service( manager ); } @@ -759,6 +788,11 @@ { if( instance instanceof Configurable ) { + if( getLogger().isDebugEnabled() ) + { + int id = System.identityHashCode( instance ); + getLogger().debug( "applying configuration to: " + id ); + } ((Configurable)instance).configure( m_model.getConfiguration() ); } } @@ -768,6 +802,11 @@ { if( instance instanceof Parameterizable ) { + if( getLogger().isDebugEnabled() ) + { + int id = System.identityHashCode( instance ); + getLogger().debug( "applying parameters to: " + id ); + } ((Parameterizable)instance).parameterize( m_model.getParameters() ); } } @@ -794,10 +833,20 @@ { if( flag ) { + if( getLogger().isDebugEnabled() ) + { + int id = System.identityHashCode( instance ); + getLogger().debug( "applying create stage to: " + id ); + } handler.create( instance, context ); } else { + if( getLogger().isDebugEnabled() ) + { + int id = System.identityHashCode( instance ); + getLogger().debug( "applying destroy stage to: " + id ); + } handler.destroy( instance, context ); } } @@ -846,10 +895,20 @@ Context context = m_model.getContextModel().getContext(); if( flag ) { + if( getLogger().isDebugEnabled() ) + { + int id = System.identityHashCode( instance ); + getLogger().debug( "applying access stage to: " + id ); + } handler.access( instance, context ); } else { + if( getLogger().isDebugEnabled() ) + { + int id = System.identityHashCode( instance ); + getLogger().debug( "applying release stage to: " + id ); + } handler.release( instance, context ); } } 1.2 +1 -1 avalon-sandbox/merlin/activation/src/java/org/apache/avalon/activation/appliance/impl/Resources.properties Index: Resources.properties =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/activation/src/java/org/apache/avalon/activation/appliance/impl/Resources.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Resources.properties 7 Aug 2003 17:11:17 -0000 1.1 +++ Resources.properties 19 Aug 2003 03:51:23 -0000 1.2 @@ -9,7 +9,7 @@ assembly.reassembly.error=Illegal attempt to re-assemble appliance [{0}]. assembly.dissassembly.transitional.error=Illegal attempt to dissassemble [{0}] while the appliance is in a state of transition. assembly.dissassembly.state.error=Illegal attempt to dissassemble a dissassembled appliance [{0}]. -assembly.context-strategy.bad-class.error=Context strategy handler class [{0}] does not implement the org.apache.avalon.activation.lifecycle.ContextualizationHandler interface. +assembly.context-strategy.bad-class.error=Context strategy handler class [{0}] does not implement the org.apache.avalon.activation.lifecycle.ContextualizationHandler interface defined in the container classloader. lifestyle.new.error=Unable to create a new component instance in appliance [{0}] due to a component deployment failure. lifecycle.instantiation.error=Could not instantiate an instance of the class [{0}]. 1.4 +24 -60 avalon-sandbox/merlin/activation/src/test/org/apache/avalon/activation/appliance/AbstractTestCase.java Index: AbstractTestCase.java =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/activation/src/test/org/apache/avalon/activation/appliance/AbstractTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AbstractTestCase.java 18 Aug 2003 11:26:05 -0000 1.3 +++ AbstractTestCase.java 19 Aug 2003 03:51:23 -0000 1.4 @@ -49,6 +49,8 @@ protected ContainmentModel m_model; + protected SystemContext m_system; + //------------------------------------------------------- // constructor //------------------------------------------------------- @@ -81,20 +83,20 @@ public void setUp() throws Exception { File base = new File( getTestDir(), "test-classes" ); - LoggingManager logging = createLoggingManager( base ); - m_logger = logging.getLoggerForCategory( "" ); - PoolManager pool = createPoolManager(); - // - // create the service context now even thought - // its not needed until we start playing with appliances - // and blocks + // + // WARNING: ALMOST EVIL + // Next couple of lines are using a convinience operation + // on DefaultSystemContext to create the system context. This + // is temporary and will be replaced when a clean configurable + // system context factory is in place // - DefaultServiceContext context = new DefaultServiceContext(); - context.put( PoolManager.ROLE, pool ); - context.put( LoggingManager.KEY, logging ); - m_context = context; + File local = new File( base, "repository" ); + SystemContext system = + DefaultSystemContext.createSystemContext( + base, local, ConsoleLogger.LEVEL_DEBUG ); + m_logger = system.getLogger(); // // load the meta data using the profile returned from getPath() @@ -102,45 +104,20 @@ // ContainmentProfile profile = setUpProfile( new File( base, getPath() ) ); - File local = new File( base, "repository" ); - m_model = setUpModel( base, local, profile ); - } + m_model = system.getFactory().createContainmentModel( profile ); - /** - * Create the containment model. - * @return the complete model - */ - public ContainmentModel setUpModel( - File base, File repository, ContainmentProfile profile ) throws Exception - { - try - { - // - // WARNING: EVIL - // Next couple of lines are using a convinience operation - // on DefaultSystemContext to create the system context. This - // temporary and will be replaced when a clean configurable - // system context factory is in place - // - - SystemContext system = - DefaultSystemContext.createSystemContext( - base, repository, ConsoleLogger.LEVEL_DEBUG ); + // + // create the service context now even thought + // its not needed until we start playing with appliances + // and blocks + // - // - // from here its good - // + PoolManager pool = createPoolManager(); + DefaultServiceContext context = new DefaultServiceContext(); + context.put( PoolManager.ROLE, pool ); + context.put( LoggingManager.KEY, system.getLoggingManager() ); + m_context = context; - DefaultModelFactory factory = new DefaultModelFactory( system ); - return factory.createContainmentModel( profile ); - } - catch( Throwable e ) - { - final String error = "Setup failure."; - final String message = ExceptionHelper.packException( error, e, true ); - getLogger().error( message ); - throw new Exception( message ); - } } protected ContainmentProfile setUpProfile( File file ) @@ -195,19 +172,6 @@ "Internal error during establishment of the default pool manager. Cause: "; throw new Exception( error + e.toString() ); } - } - - protected LoggingManager createLoggingManager( File base ) throws Exception - { - LoggingDescriptor logging = - new LoggingDescriptor( - "", "DEBUG", null, - new CategoryDirective[0], - new TargetDescriptor[0] ); - - DefaultLoggingManager manager = - new DefaultLoggingManager( base, logging ); - return manager; } protected Logger getLogger() 1.1 avalon-sandbox/merlin/activation-api/src/java/org/apache/avalon/activation/appliance/DuplicateApplianceException.java Index: DuplicateApplianceException.java =================================================================== /* ============================================================================ The Apache Software License, Version 1.1 ============================================================================ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the Apache Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and "Apache Software Foundation" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact apache@apache.org. 5. Products derived from this software may not be called "Apache", nor may "Apache" appear in their name, without prior written permission of the Apache Software Foundation. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This software consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation. For more information on the Apache Software Foundation, please see . */ package org.apache.avalon.activation.appliance; /** * Exception raised in response to an attempt to override the defintion * of an existing appliance. * * @author Avalon Development Team * @version $Revision: 1.1 $ $Date: 2003/08/19 03:51:23 $ */ public final class DuplicateApplianceException extends ApplianceException { /** * Construct a new DuplicateApplianceException instance. * * @param message The detail message for this exception. */ public DuplicateApplianceException( final String message ) { this( message, null ); } /** * Construct a new DuplicateApplianceException instance. * * @param message The detail message for this exception. * @param throwable the root cause of the exception */ public DuplicateApplianceException( final String message, final Throwable throwable ) { super( message, throwable ); } } 1.1 avalon-sandbox/merlin/activation-api/src/java/org/apache/avalon/activation/lifecycle/LifestyleException.java Index: LifestyleException.java =================================================================== /* ============================================================================ The Apache Software License, Version 1.1 ============================================================================ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the Apache Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and "Apache Software Foundation" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact apache@apache.org. 5. Products derived from this software may not be called "Apache", nor may "Apache" appear in their name, without prior written permission of the Apache Software Foundation. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This software consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation. For more information on the Apache Software Foundation, please see . */ package org.apache.avalon.activation.lifestyle; import org.apache.avalon.framework.CascadingException; /** * Exception to indicate that there was a lifestyle related error. * * @author Avalon Development Team * @version $Revision: 1.1 $ $Date: 2003/08/19 03:51:23 $ */ public class LifestyleException extends CascadingException { /** * Construct a new LifestyleException instance. * * @param message The detail message for this exception. */ public LifestyleException( final String message ) { this( message, null ); } /** * Construct a new LifestyleException instance. * * @param message The detail message for this exception. * @param throwable the root cause of the exception */ public LifestyleException( final String message, final Throwable throwable ) { super( message, throwable ); } } 1.1 avalon-sandbox/merlin/activation-api/src/java/org/apache/avalon/activation/lifecycle/LifestyleRuntimeException.java Index: LifestyleRuntimeException.java =================================================================== /* ============================================================================ The Apache Software License, Version 1.1 ============================================================================ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the Apache Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and "Apache Software Foundation" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact apache@apache.org. 5. Products derived from this software may not be called "Apache", nor may "Apache" appear in their name, without prior written permission of the Apache Software Foundation. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This software consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation. For more information on the Apache Software Foundation, please see . */ package org.apache.avalon.activation.lifestyle; import org.apache.avalon.framework.CascadingRuntimeException; /** * Exception to indicate that there was a lifestyle related runtime error. * * @author Avalon Development Team * @version $Revision: 1.1 $ $Date: 2003/08/19 03:51:23 $ */ public class LifestyleRuntimeException extends CascadingRuntimeException { /** * Construct a new LifestyleRuntimeException instance. * * @param message The detail message for this exception. */ public LifestyleRuntimeException( final String message ) { this( message, null ); } /** * Construct a new LifestyleRuntimeException instance. * * @param message The detail message for this exception. * @param throwable the root cause of the exception */ public LifestyleRuntimeException( final String message, final Throwable throwable ) { super( message, throwable ); } } 1.1 avalon-sandbox/merlin/activation-api/src/java/org/apache/avalon/activation/lifestyle/LifestyleException.java Index: LifestyleException.java =================================================================== /* ============================================================================ The Apache Software License, Version 1.1 ============================================================================ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the Apache Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and "Apache Software Foundation" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact apache@apache.org. 5. Products derived from this software may not be called "Apache", nor may "Apache" appear in their name, without prior written permission of the Apache Software Foundation. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This software consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation. For more information on the Apache Software Foundation, please see . */ package org.apache.avalon.activation.lifestyle; import org.apache.avalon.framework.CascadingException; /** * Exception to indicate that there was a lifestyle related error. * * @author Avalon Development Team * @version $Revision: 1.1 $ $Date: 2003/08/19 03:51:23 $ */ public class LifestyleException extends CascadingException { /** * Construct a new LifestyleException instance. * * @param message The detail message for this exception. */ public LifestyleException( final String message ) { this( message, null ); } /** * Construct a new LifestyleException instance. * * @param message The detail message for this exception. * @param throwable the root cause of the exception */ public LifestyleException( final String message, final Throwable throwable ) { super( message, throwable ); } } 1.1 avalon-sandbox/merlin/activation-api/src/java/org/apache/avalon/activation/lifestyle/LifestyleRuntimeException.java Index: LifestyleRuntimeException.java =================================================================== /* ============================================================================ The Apache Software License, Version 1.1 ============================================================================ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the Apache Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and "Apache Software Foundation" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact apache@apache.org. 5. Products derived from this software may not be called "Apache", nor may "Apache" appear in their name, without prior written permission of the Apache Software Foundation. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This software consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation. For more information on the Apache Software Foundation, please see . */ package org.apache.avalon.activation.lifestyle; import org.apache.avalon.framework.CascadingRuntimeException; /** * Exception to indicate that there was a lifestyle related runtime error. * * @author Avalon Development Team * @version $Revision: 1.1 $ $Date: 2003/08/19 03:51:23 $ */ public class LifestyleRuntimeException extends CascadingRuntimeException { /** * Construct a new LifestyleRuntimeException instance. * * @param message The detail message for this exception. */ public LifestyleRuntimeException( final String message ) { this( message, null ); } /** * Construct a new LifestyleRuntimeException instance. * * @param message The detail message for this exception. * @param throwable the root cause of the exception */ public LifestyleRuntimeException( final String message, final Throwable throwable ) { super( message, throwable ); } } 1.1 avalon-sandbox/merlin/activation-api/src/java/org/apache/avalon/activation/lifestyle/package.html Index: package.html ===================================================================

The lifestyle package includes interfaces and public classes supporting lifestyle management.

1.3 +6 -0 avalon-sandbox/merlin/activation-spi/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/activation-spi/project.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- project.xml 11 Aug 2003 22:58:46 -0000 1.2 +++ project.xml 19 Aug 2003 03:51:23 -0000 1.3 @@ -47,6 +47,12 @@ + avalon-activation + avalon-activation-api + SNAPSHOT + + + avalon-extension avalon-extension-spi SNAPSHOT 1.6 +16 -5 avalon-sandbox/merlin/composition/src/java/org/apache/avalon/composition/data/builder/XMLDeploymentProfileCreator.java Index: XMLDeploymentProfileCreator.java =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/composition/src/java/org/apache/avalon/composition/data/builder/XMLDeploymentProfileCreator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- XMLDeploymentProfileCreator.java 11 Aug 2003 22:58:49 -0000 1.5 +++ XMLDeploymentProfileCreator.java 19 Aug 2003 03:51:23 -0000 1.6 @@ -59,6 +59,7 @@ import org.apache.avalon.composition.data.DependencyDirective; import org.apache.avalon.composition.data.SelectionDirective; import org.apache.avalon.composition.data.*; +import org.apache.excalibur.configuration.ConfigurationUtil; /** * @@ -242,10 +243,20 @@ public CategoryDirective getCategoryDirective( Configuration config ) throws ConfigurationException { - final String name = config.getAttribute( "name" ); - final String priority = config.getAttribute( "priority", null ); - final String target = config.getAttribute( "target", null ); - return new CategoryDirective( name, priority, target ); + try + { + final String name = config.getAttribute( "name" ); + final String priority = config.getAttribute( "priority", null ); + final String target = config.getAttribute( "target", null ); + return new CategoryDirective( name, priority, target ); + } + catch( ConfigurationException e ) + { + final String error = + "Invalid category descriptor." + + ConfigurationUtil.list( config ); + throw new ConfigurationException( error, e ); + } } protected Parameters getParameters( Configuration config ) 1.13 +11 -1 avalon-sandbox/merlin/composition/src/java/org/apache/avalon/composition/model/impl/DefaultSystemContext.java Index: DefaultSystemContext.java =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/composition/src/java/org/apache/avalon/composition/model/impl/DefaultSystemContext.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- DefaultSystemContext.java 18 Aug 2003 17:02:37 -0000 1.12 +++ DefaultSystemContext.java 19 Aug 2003 03:51:23 -0000 1.13 @@ -345,6 +345,16 @@ } /** + * Return the logging manager. + * + * @return the logging manager. + */ + public LoggingManager getLoggingManager() + { + return m_logging; + } + + /** * Return the system logging channel. * * @return the system logging channel 1.6 +9 -1 avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model/SystemContext.java Index: SystemContext.java =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/composition-spi/src/java/org/apache/avalon/composition/model/SystemContext.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- SystemContext.java 11 Aug 2003 22:58:50 -0000 1.5 +++ SystemContext.java 19 Aug 2003 03:51:23 -0000 1.6 @@ -52,6 +52,7 @@ import java.io.File; +import org.apache.avalon.composition.logging.LoggingManager; import org.apache.avalon.composition.model.ModelFactory; import org.apache.avalon.repository.Repository; import org.apache.avalon.framework.context.Context; @@ -125,6 +126,13 @@ * @return the system classloader */ ClassLoader getCommonClassLoader(); + + /** + * Return the logging manager. + * + * @return the logging manager. + */ + LoggingManager getLoggingManager(); /** * Return the system logging channel. 1.4 +4 -2 avalon-sandbox/merlin/kernel/bootstrap/src/etc/merlin.properties Index: merlin.properties =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/kernel/bootstrap/src/etc/merlin.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- merlin.properties 18 Aug 2003 17:02:37 -0000 1.3 +++ merlin.properties 19 Aug 2003 03:51:23 -0000 1.4 @@ -7,7 +7,7 @@ # # the bootstrap classpath # -merlin.bootstrap.classpath.length=23 +merlin.bootstrap.classpath.length=24 merlin.bootstrap.classpath.0=xerces:xerces;2.2.1 merlin.bootstrap.classpath.1=xml-apis:xml-apis;1.0.b2 merlin.bootstrap.classpath.2=avalon-framework:avalon-framework-api;SNAPSHOT @@ -31,13 +31,15 @@ merlin.bootstrap.classpath.20=excalibur-event:excalibur-event;1.0.3 merlin.bootstrap.classpath.21=excalibur-configuration:excalibur-configuration;1.1-dev merlin.bootstrap.classpath.22=excalibur-lifecycle:excalibur-lifecycle;1.0 +merlin.bootstrap.classpath.23=avalon-activation:avalon-activation-api;SNAPSHOT # # the api classpath # -merlin.api.classpath.length=2 +merlin.api.classpath.length=3 merlin.api.classpath.0=avalon-framework:avalon-framework-api;SNAPSHOT merlin.api.classpath.1=avalon-meta:avalon-meta-api;SNAPSHOT +merlin.api.classpath.2=avalon-activation:avalon-activation-api;SNAPSHOT # # the spi classpath 1.2 +5 -0 avalon-sandbox/merlin/kernel/impl/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/kernel/impl/project.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.xml 11 Aug 2003 22:34:47 -0000 1.1 +++ project.xml 19 Aug 2003 03:51:23 -0000 1.2 @@ -31,6 +31,11 @@ avalon-activation + avalon-activation-api + SNAPSHOT + + + avalon-activation avalon-activation-spi SNAPSHOT 1.3 +5 -0 avalon-sandbox/merlin/kernel/spi/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/kernel/spi/project.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- project.xml 18 Aug 2003 11:26:06 -0000 1.2 +++ project.xml 19 Aug 2003 03:51:23 -0000 1.3 @@ -38,6 +38,11 @@ avalon-activation + avalon-activation-api + SNAPSHOT + + + avalon-activation avalon-activation-spi SNAPSHOT 1.17 +5 -0 avalon-sandbox/merlin/merlin-platform/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/project.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- project.xml 16 Aug 2003 11:16:32 -0000 1.16 +++ project.xml 19 Aug 2003 03:51:23 -0000 1.17 @@ -72,6 +72,11 @@ avalon-activation + avalon-activation-api + SNAPSHOT + + + avalon-activation avalon-activation-spi SNAPSHOT 1.3 +2 -2 avalon-sandbox/merlin/merlin-platform/tutorials/context_casting/src/java/tutorial/HelloComponent.java Index: HelloComponent.java =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/tutorials/context_casting/src/java/tutorial/HelloComponent.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- HelloComponent.java 18 Aug 2003 16:59:41 -0000 1.2 +++ HelloComponent.java 19 Aug 2003 03:51:24 -0000 1.3 @@ -20,8 +20,8 @@ * class that implements a domain specific context interface. * * @avalon.context type="tutorial.DemoContext" - * @avalon.entry key="urn:avalon:name" type="java.lang.String" - * @avalon.entry key="urn:avalon:partition" type="java.lang.String" + * @avalon.entry key="urn:avalon:name" + * @avalon.entry key="urn:avalon:partition" * @avalon.entry key="urn:avalon:home" type="java.io.File" * @avalon.entry key="urn:avalon:temp" type="java.io.File" */ 1.4 +2 -2 avalon-sandbox/merlin/merlin-platform/tutorials/context_standard/src/java/tutorial/HelloComponent.java Index: HelloComponent.java =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/tutorials/context_standard/src/java/tutorial/HelloComponent.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HelloComponent.java 18 Aug 2003 17:45:02 -0000 1.3 +++ HelloComponent.java 19 Aug 2003 03:51:24 -0000 1.4 @@ -28,8 +28,8 @@ * working directories, component name and partition. * * @avalon.context - * @avalon.entry key="urn:avalon:name" type="java.lang.String" - * @avalon.entry key="urn:avalon:partition" type="java.lang.String" + * @avalon.entry key="urn:avalon:name" + * @avalon.entry key="urn:avalon:partition" * @avalon.entry key="urn:avalon:home" type="java.io.File" * @avalon.entry key="urn:avalon:temp" type="java.io.File" */ 1.2 +1 -0 avalon-sandbox/merlin/merlin-platform/tutorials/contextualization/.cvsignore Index: .cvsignore =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/tutorials/contextualization/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- .cvsignore 18 Aug 2003 19:38:37 -0000 1.1 +++ .cvsignore 19 Aug 2003 03:51:24 -0000 1.2 @@ -3,3 +3,4 @@ build target tutorial.jar +kernel.xml \ No newline at end of file 1.2 +1 -1 avalon-sandbox/merlin/merlin-platform/tutorials/contextualization/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/tutorials/contextualization/project.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.xml 18 Aug 2003 19:38:37 -0000 1.1 +++ project.xml 19 Aug 2003 03:51:24 -0000 1.2 @@ -24,7 +24,7 @@ avalon-activation - avalon-activation-spi + avalon-activation-api SNAPSHOT 1.3 +9 -5 avalon-sandbox/merlin/merlin-platform/tutorials/contextualization/src/java/tutorial/StandardComponent.java Index: StandardComponent.java =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/tutorials/contextualization/src/java/tutorial/StandardComponent.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- StandardComponent.java 18 Aug 2003 19:38:37 -0000 1.2 +++ StandardComponent.java 19 Aug 2003 03:51:24 -0000 1.3 @@ -78,6 +78,7 @@ private String m_name; private String m_partition; private String m_message; + private StandardContext m_context; //======================================================================= // Contextualizable @@ -89,13 +90,14 @@ * @param context the context value * * @avalon.context strategy="tutorial.Contextualizable" - * @avalon.entry key="urn:avalon:name" type="java.lang.String" - * @avalon.entry key="urn:avalon:partition" type="java.lang.String" + * @avalon.entry key="urn:avalon:name" + * @avalon.entry key="urn:avalon:partition" * @avalon.entry key="urn:avalon:home" type="java.io.File" * @avalon.entry key="urn:avalon:temp" type="java.io.File" */ public void contextualize( StandardContext context ) { + m_context = context; m_home = context.getHomeDirectory(); m_work = context.getWorkingDirectory(); m_name = context.getName(); @@ -112,10 +114,13 @@ public void initialize() throws Exception { m_message = - " home: " + m_home + " strategy: " + Contextualizable.class.getName() + + "\n context: " + m_context.getClass().getName() + + "\n home: " + m_home + "\n work: " + m_work + "\n name: " + m_name + "\n partition: " + m_partition; + printMessage(); } //======================================================================= @@ -151,8 +156,7 @@ */ public void printMessage() { - getLogger().info( "context\n" - + " contextualization using a custom hander\n" + getLogger().info( "contextualization using a custom strategy\n\n" + m_message + "\n"); } } 1.4 +2 -2 avalon-sandbox/merlin/merlin-platform/tutorials/mixed/src/java/tutorial/HelloComponent.java Index: HelloComponent.java =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/tutorials/mixed/src/java/tutorial/HelloComponent.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HelloComponent.java 18 Aug 2003 17:02:37 -0000 1.3 +++ HelloComponent.java 19 Aug 2003 03:51:24 -0000 1.4 @@ -36,10 +36,10 @@ * working directories, component name and partition. * * @avalon.meta.context type="tutorial.DemoContext" + * @avalon.meta.entry key="urn:avalon:name" + * @avalon.meta.entry key="urn:avalon:partition" * @avalon.meta.entry key="urn:avalon:home" type="java.io.File" * @avalon.meta.entry key="urn:avalon:temp" type="java.io.File" - * @avalon.meta.entry key="urn:avalon:name" type="java.lang.String" - * @avalon.meta.entry key="urn:avalon:partition" type="java.lang.String" * @avalon.meta.entry key="cruncher" type="tutorial.NumberCruncher" optional="true" */ public void contextualize( Context context ) throws ContextException --------------------------------------------------------------------- To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org For additional commands, e-mail: cvs-help@avalon.apache.org