avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinay Chandran <vinay...@yahoo.com>
Subject Re: [merlin.patch] Verification of Lifecycle extension by DefaultTypeRepository
Date Mon, 14 Jul 2003 12:03:43 GMT
Steve,
Here's the patch as an attachment.
Regards,
Vinay
--- Stephen McConnell <mcconnell@apache.org> wrote:
> 
> 
> Vinay wrote:
> 
> >Patch to
>
>org.apache.avalon.assembly.engine.impl.DefaultTypeRepository
> >to enable verification of presence of lifecycle 
> >extension interface(s) declared within the
> extension
> >descriptor.
> >
> 
> Vinay:
> 
> Can you re-send the patch as an attachement ?
> 
> Steve.
> 
> >Regards,
> >Vinay
> >
> >
>
>=====================================================
> >
> >64a65
> >  
> >
> >>import
> >>    
> >>
> >org.apache.avalon.meta.info.ExtensionDescriptor;
> >194c195
> ><         }
> >---
> >  
> >
> >>        }
> >>    
> >>
> >198c199
> ><               "Unexpected error while attempting
> to
> >build a type from the clas
> >sname: "
> >---
> >  
> >
> >>              "Unexpected error while attempting
> to
> >>    
> >>
> >build a type from the clas
> >sname: "
> >378a380,381
> >  
> >
> >>        //verify existence of lifecyle extension
> >>    
> >>
> >classes
> >  
> >
> >>        Class[]
> >>    
> >>
> >lifecycleExtensions=getExtensionClasses(type);
> >403c406
> ><                 list.add( getServiceClass(
> >services[i] ) );
> >---
> >  
> >
> >>                list.add( getServiceClass( service
> )
> >>    
> >>
> >);
> >455a459,496
> >  
> >
> >>      /**
> >>       * Return the set of lifecycle extension
> >>    
> >>
> >classes provided by the given t
> >ype
> >  
> >
> >>       * @param type the component type
> >>       * @return an array of classes represnting
> the
> >>    
> >>
> >lifecycle extension inter
> >faces provided by the type
> >  
> >
> >>       */
> >>      private Class[] getExtensionClasses( Type
> type
> >>    
> >>
> >)
> >  
> >
> >>      {
> >>              ArrayList list = new ArrayList();
> >>              ExtensionDescriptor[] extensions =
> >>    
> >>
> >type.getExtensions();
> >  
> >
> >>              for( int i = 0; i <
> extensions.length;
> >>    
> >>
> >i++ )
> >  
> >
> >>              {
> >>                      ExtensionDescriptor
> extension
> >>    
> >>
> >= extensions[i];
> >  
> >
> >>                      list.add( getExtensionClass(
> >>    
> >>
> >extension ) );
> >  
> >
> >>              }
> >>              return (Class[]) list.toArray( new
> >>    
> >>
> >Class[0] );
> >  
> >
> >>      }
> >>
> >>      /**
> >>       * Returns the lifecycle extension class
> >>    
> >>
> >provided by the type.
> >  
> >
> >>       * @param extension the lifecycle extension
> >>    
> >>
> >type
> >  
> >
> >>       * @return the class implementing the
> >>    
> >>
> >extension type
> >  
> >
> >>       * @exception TypeRuntimeException if a
> >>    
> >>
> >classloader error occurs
> >  
> >
> >>       */
> >>      private Class getExtensionClass(
> >>    
> >>
> >ExtensionDescriptor extension ) throws
> >TypeRuntimeException
> >  
> >
> >>      {
> >>              final String classname =
> >>    
> >>
> >extension.getReference().getClassname()
> >;
> >  
> >
> >>              try
> >>              {
> >>                      return
> >>    
> >>
> >m_classloader.loadClass( classname );
> >  
> >
> >>              } catch( Throwable e )
> >>              {
> >>                      final String error =
> >>                                      "Could not
> >>    
> >>
> >load lifecycle extension clas
> >s of type: "
> >  
> 
=== message truncated ===


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
Mime
View raw message