You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by le...@apache.org on 2002/06/27 16:33:49 UTC

cvs commit: jakarta-avalon-excalibur/microcontainer/src/java/org/apache/excalibur/microcontainer MicroContainer.java MicroContainerComponentManager.java MicroContainerException.java

leosutic    2002/06/27 07:33:49

  Modified:    microcontainer/src/java/org/apache/excalibur/microcontainer
                        MicroContainer.java
                        MicroContainerComponentManager.java
                        MicroContainerException.java
  Log:
  no message
  
  Revision  Changes    Path
  1.4       +54 -2     jakarta-avalon-excalibur/microcontainer/src/java/org/apache/excalibur/microcontainer/MicroContainer.java
  
  Index: MicroContainer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/microcontainer/src/java/org/apache/excalibur/microcontainer/MicroContainer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MicroContainer.java	27 Jun 2002 09:45:46 -0000	1.3
  +++ MicroContainer.java	27 Jun 2002 14:33:49 -0000	1.4
  @@ -1,3 +1,53 @@
  +/*
  +
  +============================================================================
  +The Apache Software License, Version 1.1
  +============================================================================
  +
  +Copyright (C) 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", "Avalon", "Excalibur" 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 <http://www.apache.org/>.
  +
  +*/
  +
   package org.apache.excalibur.microcontainer;
   
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
  @@ -21,6 +71,8 @@
    *                                             .components( componentMap )
    *                                             .create();
    * </code></pre>
  + *
  + * @author <a href="mailto:leo.sutic@inspireinfrastructure.com">Leo Sutic</a>
    */
   public class MicroContainer {
      
  @@ -205,7 +257,7 @@
        * @param value the value.
        * @throws IllegalStateException if <code>configuration</code> has been called before.
        */
  -    public MicroContainer configurationValue( String key, String value )
  +    public MicroContainer configurationValue( String childName, String value )
       {
           if( config != null )
           {
  @@ -213,7 +265,7 @@
                   "attributes if you have set a configuration using the " +
                   "configuration(Configuration) method.");
           }
  -        DefaultConfiguration child = new DefaultConfiguration( key, "" );
  +        DefaultConfiguration child = new DefaultConfiguration( childName, "" );
           child.setValue( value );
           ownConfig.addChild( child );
           return this;
  
  
  
  1.3       +52 -0     jakarta-avalon-excalibur/microcontainer/src/java/org/apache/excalibur/microcontainer/MicroContainerComponentManager.java
  
  Index: MicroContainerComponentManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/microcontainer/src/java/org/apache/excalibur/microcontainer/MicroContainerComponentManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MicroContainerComponentManager.java	27 Jun 2002 09:45:46 -0000	1.2
  +++ MicroContainerComponentManager.java	27 Jun 2002 14:33:49 -0000	1.3
  @@ -1,3 +1,53 @@
  +/*
  +
  +============================================================================
  +The Apache Software License, Version 1.1
  +============================================================================
  +
  +Copyright (C) 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", "Avalon", "Excalibur" 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 <http://www.apache.org/>.
  +
  +*/
  +
   package org.apache.excalibur.microcontainer;
   
   import java.util.Map;
  @@ -9,6 +59,8 @@
   /**
    * An implementation of the ComponentManager interface for
    * MicroContainers.
  + *
  + * @author <a href="mailto:leo.sutic@inspireinfrastructure.com">Leo Sutic</a>
    */
   class MicroContainerComponentManager extends AbstractManager implements Component, ComponentManager, ComponentSelector
   {
  
  
  
  1.2       +72 -4     jakarta-avalon-excalibur/microcontainer/src/java/org/apache/excalibur/microcontainer/MicroContainerException.java
  
  Index: MicroContainerException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/microcontainer/src/java/org/apache/excalibur/microcontainer/MicroContainerException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MicroContainerException.java	24 Jun 2002 20:53:46 -0000	1.1
  +++ MicroContainerException.java	27 Jun 2002 14:33:49 -0000	1.2
  @@ -1,3 +1,53 @@
  +/*
  +
  +============================================================================
  +The Apache Software License, Version 1.1
  +============================================================================
  +
  +Copyright (C) 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", "Avalon", "Excalibur" 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 <http://www.apache.org/>.
  +
  +*/
  +
   package org.apache.excalibur.microcontainer;
   
   import java.io.PrintStream;
  @@ -7,9 +57,21 @@
   
   /**
    * Exception indicating a failure between the MicroContainer and its component.
  + * <p>
  + * The class does not extend <code>org.apache.avalon.framework.CascadingRuntimeException</code>
  + * as that class by default does not print out the root cause of the exception unless you
  + * use <code>org.apache.avalon.framework.ExceptionUtil</code>. It seemed to make
  + * more sense to provide an exception class that printed the root cause when its
  + * <code>printStackTrace()</code> method was called, as this exception would typically
  + * be thrown in response to something going wrong during lifecycle processing of
  + * the contained component.
  + *
  + * @author <a href="mailto:leo.sutic@inspireinfrastructure.com">Leo Sutic</a>
    */
  -public class MicroContainerException extends CascadingRuntimeException 
  +public class MicroContainerException extends RuntimeException 
   {
  +    private final Throwable cause;
  +    
       /**
        * Construct a new <code>MicroContainerException</code> instance.
        *
  @@ -18,7 +80,8 @@
        */
       public MicroContainerException( final String message, final Throwable throwable )
       {
  -        super( message, throwable );
  +        super( message );
  +        this.cause = throwable;
       }    
       
       /**
  @@ -28,7 +91,7 @@
        */
       public MicroContainerException( final String message )
       {
  -        super( message, null );
  +        this( message, null );
       }
       
       /**
  @@ -38,7 +101,12 @@
        */
       public MicroContainerException( final Throwable throwable )
       {
  -        super( throwable.toString(), throwable );
  +        this( throwable.toString(), throwable );
  +    }
  +    
  +    private Throwable getCause()
  +    {
  +        return cause;
       }
       
       public void printStackTrace()
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>