mcconnell    2003/06/19 04:24:36

  Modified:    merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/impl
                        DefaultContextualizationService.java
  Log:
  Reverse order of contextualization interface handling.
  
  Revision  Changes    Path
  1.5       +25 -25    
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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultContextualizationService.java      7 Jun 2003 21:12:47 -0000       1.4
  +++ DefaultContextualizationService.java      19 Jun 2003 11:24:36 -0000      1.5
  @@ -134,16 +134,16 @@
                   }
               }
   
  -            if( object instanceof Contextualizable )
  +            if( object instanceof 
org.apache.avalon.assembly.locator.Contextualizable )
               {
                   //
  -                // its classic Avalon contextulization
  +                // locator contextulization
                   //
   
  -                Contextualization contextualizer = new AvalonContextualizer();
  +                Contextualization contextualizer = new DefaultContextualizer();
                   if( getLogger().isDebugEnabled() )
                   {
  -                    final String message = appliance.toString() + " (Avalon 
Policy)";
  +                    final String message = appliance.toString() + " (Locator 
Policy)";
                       getLogger().debug( message );
                   }
                   try
  @@ -151,35 +151,23 @@
                       contextualizer.contextualize(
                         loader, appliance.getContextDirective(), object, context );
                   }
  -                catch( ContextException e )
  -                {
  -                    //
  -                    // this could be improved if the framework ContextException
  -                    // held the context key that the client is accessing
  -                    //
  -
  -                    final String error =
  -                       "Target component is requesting a context entry that has not 
been declared."
  -                       + " Please check component xinfo descriptor context criteria 
in type: "
  -                       + appliance.getType();
  -                    throw new ContextException( error, e );
  -                } catch( Throwable e )
  +                catch( Throwable e )
                   {
                       final String error =
  -                            "Unexpected exception during contextualization of 
target: " + appliance;
  +                      "Unexpected exception during contextualization of target: " + 
appliance;
                       throw new ContextException( error, e );
                   }
               }
  -            else if( object instanceof 
org.apache.avalon.assembly.locator.Contextualizable )
  +            else if( object instanceof Contextualizable )
               {
                   //
  -                // locator contextulization
  +                // its classic Avalon contextulization
                   //
   
  -                Contextualization contextualizer = new DefaultContextualizer();
  +                Contextualization contextualizer = new AvalonContextualizer();
                   if( getLogger().isDebugEnabled() )
                   {
  -                    final String message = appliance.toString() + " (Locator 
Policy)";
  +                    final String message = appliance.toString() + " (Avalon 
Policy)";
                       getLogger().debug( message );
                   }
                   try
  @@ -187,10 +175,22 @@
                       contextualizer.contextualize(
                         loader, appliance.getContextDirective(), object, context );
                   }
  -                catch( Throwable e )
  +                catch( ContextException e )
  +                {
  +                    //
  +                    // this could be improved if the framework ContextException
  +                    // held the context key that the client is accessing
  +                    //
  +
  +                    final String error =
  +                       "Target component is requesting a context entry that has not 
been declared."
  +                       + " Please check component xinfo descriptor context criteria 
in type: "
  +                       + appliance.getType();
  +                    throw new ContextException( error, e );
  +                } catch( Throwable e )
                   {
                       final String error =
  -                      "Unexpected exception during contextualization of target: " + 
appliance;
  +                            "Unexpected exception during contextualization of 
target: " + appliance;
                       throw new ContextException( error, e );
                   }
               }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to