avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifestyle/impl AbstractLifestyleHandler.java
Date Sat, 07 Jun 2003 21:12:47 GMT
mcconnell    2003/06/07 14:12:47

  Modified:    merlin/assembly/src/java/org/apache/avalon/assembly/appliance/impl
                        DefaultAppliance.java
               merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/impl
                        DefaultContextualizationService.java
                        DefaultDeploymentService.java
               merlin/assembly/src/java/org/apache/avalon/assembly/lifestyle/impl
                        AbstractLifestyleHandler.java
  Log:
  Applied patches from David Bernard dealing with case where a component uses a custom stage
but does not declare a contextualization stage.
  
  Revision  Changes    Path
  1.9       +5 -1      avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/appliance/impl/DefaultAppliance.java
  
  Index: DefaultAppliance.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/appliance/impl/DefaultAppliance.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultAppliance.java	29 May 2003 21:00:03 -0000	1.8
  +++ DefaultAppliance.java	7 Jun 2003 21:12:47 -0000	1.9
  @@ -749,6 +749,10 @@
           {
               return true;
           }
  +        else if ( getType().getStages().length > 0 )
  +        {
  +            return true;
  +        }
           else if( Contextualizable.class.isAssignableFrom( m_class ) )
           {
               return true;
  
  
  
  1.4       +3 -16     avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/impl/DefaultContextualizationService.java
  
  Index: DefaultContextualizationService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/impl/DefaultContextualizationService.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultContextualizationService.java	4 Jun 2003 09:28:44 -0000	1.3
  +++ DefaultContextualizationService.java	7 Jun 2003 21:12:47 -0000	1.4
  @@ -125,7 +125,8 @@
                         loader, appliance.getContextDirective(), object, context );
                       provider.release( handler, this );
                       return;
  -                } catch( Throwable e )
  +                } 
  +                catch( Throwable e )
                   {
                       final String error =
                               "Contextualization handler failure in appliance: " + appliance;
  @@ -192,20 +193,6 @@
                         "Unexpected exception during contextualization of target: " + appliance;
                       throw new ContextException( error, e );
                   }
  -            }
  -            else
  -            {
  -                //
  -                // the appliance has established a context argument for classic Avalon
  -                // contextualization but the target object does not implement the
  -                // Avalon or Locator Contextualization interface
  -                //
  -
  -                final String error =
  -                  "Appliance "
  -                  + appliance
  -                  + " is handling an object that is declaring a contextualization dependency
but does not implement the Avalon or Locator Contextualization interface.";
  -                throw new ContextException( error );
               }
           }
       }
  
  
  
  1.10      +13 -7     avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/impl/DefaultDeploymentService.java
  
  Index: DefaultDeploymentService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/impl/DefaultDeploymentService.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultDeploymentService.java	4 Jun 2003 09:43:44 -0000	1.9
  +++ DefaultDeploymentService.java	7 Jun 2003 21:12:47 -0000	1.10
  @@ -542,9 +542,12 @@
   
               try
               {
  -                Creator handler = (Creator) provider.resolve( this );
  -                handler.create( 
  -                  object, new DefaultLocator( appliance.getContextMap() ) );
  +                Object handler = provider.resolve( this );
  +                if (handler instanceof Creator)
  +                {
  +                    ((Creator)handler).create(
  +                        object, new DefaultLocator( appliance.getContextMap() ) );
  +                }
                   provider.release( handler, this );
               }
               catch( Throwable e )
  @@ -592,9 +595,12 @@
   
               try
               {
  -                Creator handler = (Creator) provider.resolve( this );
  -                handler.destroy( 
  -                  object, new DefaultLocator( appliance.getContextMap() ) );
  +                Object handler = provider.resolve( this );
  +                if (handler instanceof Creator)
  +                {
  +                    ((Creator) handler).destroy(
  +                        object, new DefaultLocator( appliance.getContextMap() ) );
  +                }
                   provider.release( handler, this );
               }
               catch( Throwable e )
  
  
  
  1.4       +3 -2      avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifestyle/impl/AbstractLifestyleHandler.java
  
  Index: AbstractLifestyleHandler.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifestyle/impl/AbstractLifestyleHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractLifestyleHandler.java	3 Jun 2003 17:14:51 -0000	1.3
  +++ AbstractLifestyleHandler.java	7 Jun 2003 21:12:47 -0000	1.4
  @@ -74,7 +74,8 @@
    * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
    * @version $Revision$ $Date$
    */
  -public abstract class AbstractLifestyleHandler extends AbstractLogEnabled implements Contextualizable,
Initializable, Disposable, LifestyleHandler
  +public abstract class AbstractLifestyleHandler extends AbstractLogEnabled 
  +  implements Contextualizable, Initializable, Disposable, LifestyleHandler
   {
       //==============================================================
       // state
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message