avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/container MetaDataContainer.java
Date Thu, 19 Sep 2002 04:07:23 GMT
bloritsch    2002/09/18 21:07:23

  Modified:    fortress build.xml default.properties
               fortress/src/java/org/apache/excalibur/fortress/container
                        MetaDataContainer.java
  Log:
  add in the verifier stuff
  
  Revision  Changes    Path
  1.51      +0 -14     jakarta-avalon-excalibur/fortress/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/build.xml,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- build.xml	11 Sep 2002 19:13:25 -0000	1.50
  +++ build.xml	19 Sep 2002 04:07:23 -0000	1.51
  @@ -82,19 +82,6 @@
         <copy file="${excalibur-meta.jar}" todir="${build.dir}/tempjars"/>
         <copy file="${excalibur-threadcontext.jar}" todir="${build.dir}/tempjars"/>
         <copy file="${build.lib}/${jar.name}" todir="${build.dir}/tempjars"/>
  -      <copy todir="${build.dir}/tempjars">
  -        <fileset dir="../assembly/build/lib">
  -          <include name="*.jar"/>
  -        </fileset>
  -      </copy>
  -      <copy todir="${build.dir}/tempjars">
  -        <fileset dir="../assembly/lib">
  -          <include name="*.jar"/>
  -          <exclude name="avalon-framework.jar"/>
  -          <exclude name="logkit.jar"/>
  -        </fileset>
  -      </copy>
  -
   
         <jar destfile="${build.lib}/${name}-complete-${version}.jar">
           <manifest>
  @@ -126,7 +113,6 @@
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkLogger"/>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkContainer"/>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkMeta"/>
  -        <ant antfile="../assembly/build.xml" target="dist" inheritAll="false"/>
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkRequiredClass">
               <property name="proj.jar.name" value="xml-apis.jar"/>
               <property name="class" value="org.xml.sax.InputSource"/>
  
  
  
  1.36      +0 -10     jakarta-avalon-excalibur/fortress/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/default.properties,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- default.properties	11 Sep 2002 19:13:25 -0000	1.35
  +++ default.properties	19 Sep 2002 04:07:23 -0000	1.36
  @@ -84,16 +84,6 @@
   excalibur-threadcontext.lib=${excalibur-threadcontext.home}
   excalibur-threadcontext.jar=${excalibur-threadcontext.lib}/excalibur-threadcontext-1.0.jar
   
  -# ----- Excalibur container, version 1.0 or later -----
  -excalibur-container.home=${basedir}/../container/dist
  -excalibur-container.lib=${excalibur-container.home}
  -excalibur-container.jar=${excalibur-container.lib}/excalibur-container-1.0.jar
  -
  -# ----- Excalibur meta, version 1.0 or later -----
  -excalibur-meta.home=${basedir}/../meta/dist
  -excalibur-meta.lib=${excalibur-meta.home}
  -excalibur-meta.jar=${excalibur-meta.lib}/excalibur-meta-1.0.jar
  -
   # ----- AltRMI -----
   excalibur-altrmi.home=${basedir}/../altrmi/dist
   excalibur-altrmi-common.jar=${excalibur-altrmi.home}/excalibur-altrmi-common-0.7.jar
  
  
  
  1.4       +116 -5    jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/container/MetaDataContainer.java
  
  Index: MetaDataContainer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/container/MetaDataContainer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MetaDataContainer.java	18 Sep 2002 20:55:43 -0000	1.3
  +++ MetaDataContainer.java	19 Sep 2002 04:07:23 -0000	1.4
  @@ -51,7 +51,9 @@
   
   import java.lang.reflect.Constructor;
   import java.util.ArrayList;
  +import java.util.HashMap;
   import java.util.Iterator;
  +import java.util.Map;
   import java.util.List;
   
   import org.apache.avalon.excalibur.collections.BucketMap;
  @@ -77,6 +79,9 @@
   import org.apache.excalibur.instrument.InstrumentManager;
   import org.apache.excalibur.mpool.PoolManager;
   
  +import org.apache.excalibur.meta.info.*;
  +import org.apache.excalibur.meta.info.builder.*;
  +import org.apache.excalibur.meta.verifier.*;
   
   /**
    * The MetaDataContainer is the wave of the future.  While the
  @@ -99,15 +104,20 @@
       protected Configuration  m_assemblyInfo;
       protected ServiceManager m_parentManager;
       protected ClassLoader    m_loader;
  -    protected LoggerManager m_logManager;
  -    protected PoolManager m_poolManager;
  -    protected Queue m_commandQueue;
  -    protected InstrumentManager m_instrumentManager;
  +    protected LoggerManager  m_logManager;
  +    protected PoolManager    m_poolManager;
  +    protected Queue          m_commandQueue;
  +    protected InstrumentManager         m_instrumentManager;
       protected LifecycleExtensionManager m_extManager;
   
  +    protected Map m_services;
  +    protected Map m_types;
  +
       public MetaDataContainer()
       {
           m_jarEntries = JarScanner.getSystemJarEntries();
  +        m_services = new HashMap();
  +        m_types    = new HashMap();
       }
   
       /**
  @@ -179,6 +189,107 @@
   
       public void initialize() throws Exception
       {
  +        BlockBuilder   blockBuilder   = new BlockBuilder();
  +        TypeBuilder    typeBuilder    = new TypeBuilder();
  +        ServiceBuilder serviceBuilder = new ServiceBuilder();
  +        ComponentVerifier verifier    = new ComponentVerifier();
  +
  +        blockBuilder.enableLogging( getLogger().getChildLogger( "builder.block" ) );
  +        typeBuilder.enableLogging( getLogger().getChildLogger( "builder.type" ) );
  +        serviceBuilder.enableLogging( getLogger().getChildLogger( "builder.service" ) );
  +        verifier.enableLogging( getLogger().getChildLogger( "verifier" ) );
  +
  +        Iterator it = m_jarEntries.getServiceEntries().iterator();
  +        while ( it.hasNext() )
  +        {
  +            String name = (String) it.next();
  +            try
  +            {
  +                Class service = m_loader.loadClass( name );
  +                m_services.put( service, serviceBuilder.build( service ) );
  +                verifier.verifyService( service.getName(), service );
  +            }
  +            catch ( Exception e )
  +            {
  +                getLogger().debug( "Could not read the descriptor for " + name, e );
  +            }
  +        }
  +
  +        it = m_jarEntries.getBlockEntries().iterator();
  +        while ( it.hasNext() )
  +        {
  +            String name = (String) it.next();
  +            try
  +            {
  +                Class block = m_loader.loadClass( name );
  +                m_types.put( block, blockBuilder.build( block ) );
  +
  +                Type check = (Type) m_types.get( block );
  +                ServiceDescriptor[] serviceDescriptors = check.getServices();
  +
  +                Class[] services = new Class[ serviceDescriptors.length ];
  +                for ( int i = 0; i < serviceDescriptors.length; i++ )
  +                {
  +                    services[i] = m_loader.loadClass(
  +                        serviceDescriptors[i].getService().getClassname()
  +                    );
  +                }
  +
  +                StageDescriptor[] phaseDescriptors = check.getPhases();
  +
  +                Class[] phases = new Class[ phaseDescriptors.length ];
  +                for ( int i = 0; i < phaseDescriptors.length; i++ )
  +                {
  +                    phases[i] = m_loader.loadClass(
  +                        phaseDescriptors[i].getReference().getClassname()
  +                    );
  +                }
  +
  +                verifier.verifyType( block.getName(), block, services, phases );
  +            }
  +            catch ( Exception e )
  +            {
  +                getLogger().debug( "Could not read the descriptor for " + name, e );
  +            }
  +        }
  +
  +        it = m_jarEntries.getTypeEntries().iterator();
  +        while ( it.hasNext() )
  +        {
  +            String name = (String) it.next();
  +            try
  +            {
  +                Class type = m_loader.loadClass( name );
  +                m_types.put( type, typeBuilder.build( type ) );
  +
  +                Type check = (Type) m_types.get( type );
  +                ServiceDescriptor[] serviceDescriptors = check.getServices();
  +
  +                Class[] services = new Class[ serviceDescriptors.length ];
  +                for ( int i = 0; i < serviceDescriptors.length; i++ )
  +                {
  +                    services[i] = m_loader.loadClass(
  +                        serviceDescriptors[i].getService().getClassname()
  +                    );
  +                }
  +
  +                StageDescriptor[] phaseDescriptors = check.getPhases();
  +
  +                Class[] phases = new Class[ phaseDescriptors.length ];
  +                for ( int i = 0; i < phaseDescriptors.length; i++ )
  +                {
  +                    phases[i] = m_loader.loadClass(
  +                        phaseDescriptors[i].getReference().getClassname()
  +                    );
  +                }
  +
  +                verifier.verifyType( type.getName(), type, services, phases );
  +            }
  +            catch ( Exception e )
  +            {
  +                getLogger().debug( "Could not read the descriptor for " + name, e );
  +            }
  +        }
       }
   
       public void dispose()
  
  
  

--
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