avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/assembler Assembler.java
Date Sun, 26 Jan 2003 23:32:43 GMT
hammant     2003/01/26 15:32:43

  Modified:    src/java/org/apache/avalon/phoenix/components/application
                        ListenerResourceProvider.java
               src/java/org/apache/avalon/phoenix/components/assembler
                        Assembler.java
  Log:
  Listeners broken in 4.1? Patch from Peter D.
  
  Revision  Changes    Path
  1.6       +8 -7      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/ListenerResourceProvider.java
  
  Index: ListenerResourceProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/ListenerResourceProvider.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ListenerResourceProvider.java	25 Jan 2003 15:47:17 -0000	1.5
  +++ ListenerResourceProvider.java	26 Jan 2003 23:32:43 -0000	1.6
  @@ -18,8 +18,9 @@
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.phoenix.interfaces.ApplicationContext;
  -import org.apache.avalon.phoenix.metadata.BlockListenerMetaData;
   import org.apache.avalon.phoenix.containerkit.lifecycle.ResourceProvider;
  +import org.apache.avalon.phoenix.containerkit.metadata.ComponentMetaData;
  +import org.apache.avalon.phoenix.containerkit.registry.ComponentProfile;
   
   /**
    * The accessor used to access resources for a particular
  @@ -60,7 +61,7 @@
       public Object createObject( final Object entry )
           throws Exception
       {
  -        final BlockListenerMetaData metaData = getMetaData( entry );
  +        final ComponentMetaData metaData = getMetaData( entry );
           final ClassLoader classLoader = m_context.getClassLoader();
           final Class clazz =
               classLoader.loadClass( metaData.getImplementationKey() );
  @@ -77,7 +78,7 @@
       public Logger createLogger( final Object entry )
           throws Exception
       {
  -        final BlockListenerMetaData metaData = getMetaData( entry );
  +        final ComponentMetaData metaData = getMetaData( entry );
           final String name = metaData.getName();
           return m_context.getLogger( name );
       }
  @@ -112,7 +113,7 @@
       public Configuration createConfiguration( final Object entry )
           throws Exception
       {
  -        final BlockListenerMetaData metaData = getMetaData( entry );
  +        final ComponentMetaData metaData = getMetaData( entry );
           final String name = metaData.getName();
           try
           {
  @@ -145,8 +146,8 @@
        * @param entry the entry
        * @return the metadata
        */
  -    private BlockListenerMetaData getMetaData( final Object entry )
  +    private ComponentMetaData getMetaData( final Object entry )
       {
  -        return (BlockListenerMetaData)entry;
  +        return ( (ComponentProfile)entry ).getMetaData();
       }
   }
  
  
  
  1.3       +11 -10    jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/assembler/Assembler.java
  
  Index: Assembler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/assembler/Assembler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Assembler.java	25 Jan 2003 15:47:18 -0000	1.2
  +++ Assembler.java	26 Jan 2003 23:32:43 -0000	1.3
  @@ -9,6 +9,7 @@
   
   import java.util.ArrayList;
   import java.util.Map;
  +import java.util.List;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.configuration.Configuration;
  @@ -68,7 +69,7 @@
        * @throws AssemblyException if an error occurs
        */
       private PartitionMetaData assembleSar( final String name,
  -                                          final Configuration assembly )
  +                                           final Configuration assembly )
           throws AssemblyException
       {
           final Configuration[] blockConfig = assembly.getChildren( "block" );
  @@ -79,7 +80,7 @@
                                      PartitionMetaData.EMPTY_SET,
                                      blocks, Attribute.EMPTY_SET );
   
  -        final Configuration[] listenerConfig = assembly.getChildren( "listeners" );
  +        final Configuration[] listenerConfig = assembly.getChildren( "listener" );
           final ComponentMetaData[] listeners = buildBlockListeners( listenerConfig );
           final PartitionMetaData listenerPartition =
               new PartitionMetaData( ContainerConstants.LISTENER_PARTITION,
  @@ -163,20 +164,20 @@
        * the &lt;listener .../&gt; sections in <tt>assembly.xml</tt>.
        *
        * @param config the list of Configuration objects for config
  -     * @return the ComponentMetaData array
  +     * @return the array of listeners
        * @throws AssemblyException if an error occurs
        */
       private ComponentMetaData[] buildBlockListeners( final Configuration[] config )
           throws AssemblyException
       {
  -        final ArrayList listeners = new ArrayList();
  +        final List listeners = new ArrayList();
           for( int i = 0; i < config.length; i++ )
           {
               final ComponentMetaData listener = buildBlockListener( config[ i ] );
               listeners.add( listener );
           }
  -
  -        return (ComponentMetaData[])listeners.toArray( new ComponentMetaData[ listeners.size()
] );
  +        return (ComponentMetaData[])listeners.
  +            toArray( new ComponentMetaData[ listeners.size() ] );
       }
   
       /**
  @@ -193,11 +194,11 @@
           try
           {
               final String name = listener.getAttribute( "name" );
  -            final String className = listener.getAttribute( "class" );
  +            final String classname = listener.getAttribute( "class" );
   
  -            return new ComponentMetaData( name, className,
  +            return new ComponentMetaData( name, classname,
                                             new DependencyMetaData[ 0 ],
  -                                          null, null, null );
  +                                          null, null, Attribute.EMPTY_SET );
           }
           catch( final ConfigurationException ce )
           {
  
  
  

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


Mime
View raw message