avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/verifier AssemblyVerifier.java MetaDataVerifier.java
Date Sat, 06 Jul 2002 01:13:02 GMT
donaldp     2002/07/05 18:13:02

  Modified:    containerkit/src/java/org/apache/excalibur/containerkit/dependency
                        DependencyMap.java
               containerkit/src/java/org/apache/excalibur/containerkit/kernel
                        AbstractServiceKernel.java ComponentEntry.java
                        SimpleResourceProvider.java
                        SimpleServiceKernel.java
               containerkit/src/java/org/apache/excalibur/containerkit/lifecycle/impl
                        AbstractResourceProvider.java
               containerkit/src/java/org/apache/excalibur/containerkit/metadata
                        Association.java package.html
               containerkit/src/java/org/apache/excalibur/containerkit/verifier
                        AssemblyVerifier.java MetaDataVerifier.java
  Added:       containerkit/src/java/org/apache/excalibur/containerkit/metadata
                        ComponentProfile.java
  Removed:     containerkit/src/java/org/apache/excalibur/containerkit/metadata
                        ComponentPolicy.java
  Log:
  More name cleanups
  
  Revision  Changes    Path
  1.8       +30 -30    jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/dependency/DependencyMap.java
  
  Index: DependencyMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/dependency/DependencyMap.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DependencyMap.java	6 Jul 2002 00:58:38 -0000	1.7
  +++ DependencyMap.java	6 Jul 2002 01:13:01 -0000	1.8
  @@ -8,7 +8,7 @@
   package org.apache.excalibur.containerkit.dependency;
   
   import java.util.ArrayList;
  -import org.apache.excalibur.containerkit.metadata.ComponentPolicy;
  +import org.apache.excalibur.containerkit.metadata.ComponentProfile;
   import org.apache.excalibur.containerkit.metadata.Association;
   import org.apache.excalibur.containerkit.metainfo.DependencyDescriptor;
   
  @@ -76,57 +76,57 @@
        *
        * @param component the component
        */
  -    public void add( final ComponentPolicy component )
  +    public void add( final ComponentProfile component )
       {
           m_components.add( component );
       }
   
       /**
  -     * Get the serilized graph of {@link ComponentPolicy} objects
  +     * Get the serilized graph of {@link ComponentProfile} objects
        * required when starting up all the components. This makes sure
        * that all providers occur before their coresponding
        * consumers in graph.
        *
        * @return the ordered list of components
        */
  -    public ComponentPolicy[] getStartupGraph()
  +    public ComponentProfile[] getStartupGraph()
       {
           return walkGraph( true );
       }
   
       /**
  -     * Get the serilized graph of {@link ComponentPolicy} objects
  +     * Get the serilized graph of {@link ComponentProfile} objects
        * required when shutting down all the components. This makes
        * sure that all consumers occur before their coresponding
        * providers in graph.
        *
        * @return the ordered list of components
        */
  -    public ComponentPolicy[] getShutdownGraph()
  +    public ComponentProfile[] getShutdownGraph()
       {
           return walkGraph( false );
       }
   
       /**
  -     * Get the serilized graph of {@link ComponentPolicy} objects
  +     * Get the serilized graph of {@link ComponentProfile} objects
        * that use services of specified component.
        *
        * @param component the component
        * @return the ordered list of consumers
        */
  -    public ComponentPolicy[] getConsumerGraph( final ComponentPolicy component )
  +    public ComponentProfile[] getConsumerGraph( final ComponentProfile component )
       {
           return getComponentGraph( component, false );
       }
   
       /**
  -     * Get the serilized graph of {@link ComponentPolicy} objects
  +     * Get the serilized graph of {@link ComponentProfile} objects
        * that provide specified component with services.
        *
        * @param component the component
        * @return the ordered list of providers
        */
  -    public ComponentPolicy[] getProviderGraph( final ComponentPolicy component )
  +    public ComponentProfile[] getProviderGraph( final ComponentProfile component )
       {
           return getComponentGraph( component, true );
       }
  @@ -138,7 +138,7 @@
        * @param providers true if traversing providers, false if consumers
        * @return the list of components in graph
        */
  -    private ComponentPolicy[] getComponentGraph( final ComponentPolicy component, final boolean providers )
  +    private ComponentProfile[] getComponentGraph( final ComponentProfile component, final boolean providers )
       {
           final ArrayList result = new ArrayList();
           visitcomponent( component,
  @@ -146,8 +146,8 @@
                           new ArrayList(),
                           result );
   
  -        final ComponentPolicy[] returnValue = new ComponentPolicy[ result.size() ];
  -        return (ComponentPolicy[])result.toArray( returnValue );
  +        final ComponentProfile[] returnValue = new ComponentProfile[ result.size() ];
  +        return (ComponentProfile[])result.toArray( returnValue );
       }
   
       /**
  @@ -158,7 +158,7 @@
        * @param providers true if forward dependencys traced, false if dependencies reversed
        * @return the ordered node names
        */
  -    private ComponentPolicy[] walkGraph( final boolean providers )
  +    private ComponentProfile[] walkGraph( final boolean providers )
       {
           final ArrayList result = new ArrayList();
           final ArrayList done = new ArrayList();
  @@ -166,16 +166,16 @@
           final int size = m_components.size();
           for( int i = 0; i < size; i++ )
           {
  -            final ComponentPolicy component =
  -                (ComponentPolicy)m_components.get( i );
  +            final ComponentProfile component =
  +                (ComponentProfile)m_components.get( i );
               visitcomponent( component,
                               providers,
                               done,
                               result );
           }
   
  -        final ComponentPolicy[] returnValue = new ComponentPolicy[ result.size() ];
  -        return (ComponentPolicy[])result.toArray( returnValue );
  +        final ComponentProfile[] returnValue = new ComponentProfile[ result.size() ];
  +        return (ComponentProfile[])result.toArray( returnValue );
       }
   
       /**
  @@ -187,7 +187,7 @@
        * @param order the order in which nodes have already been
        *             traversed
        */
  -    private void visitcomponent( final ComponentPolicy component,
  +    private void visitcomponent( final ComponentProfile component,
                                    final boolean providers,
                                    final ArrayList done,
                                    final ArrayList order )
  @@ -215,9 +215,9 @@
        * Traverse graph of components that provide services to
        * the specified component.
        *
  -     * @param component the ComponentMetaData
  +     * @param component the ComponentProfile
        */
  -    private void visitProviders( final ComponentPolicy component,
  +    private void visitProviders( final ComponentProfile component,
                                    final ArrayList done,
                                    final ArrayList order )
       {
  @@ -235,7 +235,7 @@
   
               if( dependency != null )
               {
  -                final ComponentPolicy other =
  +                final ComponentProfile other =
                     getComponent( dependency.getProviderName() );
                   visitcomponent( other, true, done, order );
               }
  @@ -246,9 +246,9 @@
        * Traverse all Consumers of component. ie Anyone that uses
        * service provided by component.
        *
  -     * @param component the ComponentMetaData
  +     * @param component the ComponentProfile
        */
  -    private void visitConsumers( final ComponentPolicy component,
  +    private void visitConsumers( final ComponentProfile component,
                                    final ArrayList done,
                                    final ArrayList order )
       {
  @@ -257,8 +257,8 @@
           final int size = m_components.size();
           for( int i = 0; i < size; i++ )
           {
  -            final ComponentPolicy other =
  -                (ComponentPolicy)m_components.get( i );
  +            final ComponentProfile other =
  +                (ComponentProfile)m_components.get( i );
               final Association[] roles = other.getDependencies();
   
               for( int j = 0; j < roles.length; j++ )
  @@ -285,13 +285,13 @@
        * @param name the name of component
        * @return the component
        */
  -    private ComponentPolicy getComponent( final String name )
  +    private ComponentProfile getComponent( final String name )
       {
           final int size = m_components.size();
           for( int i = 0; i < size; i++ )
           {
  -            final ComponentPolicy component =
  -                (ComponentPolicy)m_components.get( i );
  +            final ComponentProfile component =
  +                (ComponentProfile)m_components.get( i );
               if( component.getName().equals( name ) )
               {
                   return component;
  
  
  
  1.14      +12 -12    jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/AbstractServiceKernel.java
  
  Index: AbstractServiceKernel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/AbstractServiceKernel.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AbstractServiceKernel.java	6 Jul 2002 00:58:38 -0000	1.13
  +++ AbstractServiceKernel.java	6 Jul 2002 01:13:01 -0000	1.14
  @@ -17,7 +17,7 @@
   import org.apache.excalibur.containerkit.dependency.DependencyMap;
   import org.apache.excalibur.containerkit.lifecycle.LifecycleHelper;
   import org.apache.excalibur.containerkit.lifecycle.ResourceProvider;
  -import org.apache.excalibur.containerkit.metadata.ComponentPolicy;
  +import org.apache.excalibur.containerkit.metadata.ComponentProfile;
   
   /**
    * The <code>AbstractServiceKernel</code> defines an application scope through
  @@ -88,7 +88,7 @@
       protected final void startupAllComponents()
           throws Exception
       {
  -        final ComponentPolicy[] components = m_dependencyMap.getStartupGraph();
  +        final ComponentProfile[] components = m_dependencyMap.getStartupGraph();
           processComponents( true, components );
       }
   
  @@ -99,7 +99,7 @@
       protected final void shutdownAllComponents()
           throws Exception
       {
  -        final ComponentPolicy[] components = m_dependencyMap.getShutdownGraph();
  +        final ComponentProfile[] components = m_dependencyMap.getShutdownGraph();
           processComponents( false, components );
       }
   
  @@ -112,8 +112,8 @@
           throws Exception
       {
           final ComponentEntry entry = (ComponentEntry)m_entrys.get( name );
  -        final ComponentPolicy[] components =
  -            m_dependencyMap.getProviderGraph( entry.getMetaData() );
  +        final ComponentProfile[] components =
  +            m_dependencyMap.getProviderGraph( entry.getProfile() );
           processComponents( true, components );
       }
   
  @@ -126,8 +126,8 @@
           throws Exception
       {
           final ComponentEntry entry = (ComponentEntry)m_entrys.get( name );
  -        final ComponentPolicy[] components =
  -            m_dependencyMap.getConsumerGraph( entry.getMetaData() );
  +        final ComponentProfile[] components =
  +            m_dependencyMap.getConsumerGraph( entry.getProfile() );
           processComponents( false, components );
       }
   
  @@ -138,7 +138,7 @@
        *
        * @param component the component
        */
  -    protected final void addComponent( final ComponentPolicy component )
  +    protected final void addComponent( final ComponentProfile component )
       {
           final String name = component.getName();
           final ComponentEntry entry = new ComponentEntry( component );
  @@ -169,7 +169,7 @@
        *         through the phases
        */
       private void processComponents( final boolean startup,
  -                                    final ComponentPolicy[] components )
  +                                    final ComponentProfile[] components )
           throws Exception
       {
           processComponentsNotice( components, startup );
  @@ -193,7 +193,7 @@
        * @throws Exception if there is error processing any of the components
        *         through the phases
        */
  -    private void processComponent( final ComponentPolicy component,
  +    private void processComponent( final ComponentProfile component,
                                      final boolean startup )
           throws Exception
       {
  @@ -250,7 +250,7 @@
        * @param order the order the components will be processed in
        * @param startup true if application startup phase, false if shutdown phase
        */
  -    private void processComponentsNotice( final ComponentPolicy[] order,
  +    private void processComponentsNotice( final ComponentProfile[] order,
                                             final boolean startup )
       {
           if( getLogger().isInfoEnabled() )
  
  
  
  1.9       +10 -10    jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/ComponentEntry.java
  
  Index: ComponentEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/ComponentEntry.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ComponentEntry.java	6 Jul 2002 00:58:38 -0000	1.8
  +++ ComponentEntry.java	6 Jul 2002 01:13:01 -0000	1.9
  @@ -7,7 +7,7 @@
    */
   package org.apache.excalibur.containerkit.kernel;
   
  -import org.apache.excalibur.containerkit.metadata.ComponentPolicy;
  +import org.apache.excalibur.containerkit.metadata.ComponentProfile;
   
   /**
    * This is the structure that components are contained within when
  @@ -20,10 +20,10 @@
   public class ComponentEntry
   {
       /**
  -     * The {@link ComponentPolicy} that describes
  +     * The {@link ComponentProfile} that describes
        * this component.
        */
  -    private final ComponentPolicy m_metaData;
  +    private final ComponentProfile m_profile;
   
       /**
        * The instance of this component.
  @@ -32,20 +32,20 @@
   
       /**
        * Creation of a new <code>ComponentEntry</code> instance.
  -     * @param metaData the {@link ComponentPolicy} instance defining the component.
  +     * @param profile the {@link ComponentProfile} instance defining the component.
        */
  -    public ComponentEntry( final ComponentPolicy metaData )
  +    public ComponentEntry( final ComponentProfile profile )
       {
  -        m_metaData = metaData;
  +        m_profile = profile;
       }
   
       /**
  -     * Returns the underlying {@link ComponentPolicy} instance.
  +     * Returns the underlying {@link ComponentProfile} instance.
        * @return the component meta data instance
        */
  -    public ComponentPolicy getMetaData()
  +    public ComponentProfile getProfile()
       {
  -        return m_metaData;
  +        return m_profile;
       }
   
       /**
  
  
  
  1.3       +6 -6      jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/SimpleResourceProvider.java
  
  Index: SimpleResourceProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/SimpleResourceProvider.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SimpleResourceProvider.java	6 Jul 2002 00:58:38 -0000	1.2
  +++ SimpleResourceProvider.java	6 Jul 2002 01:13:01 -0000	1.3
  @@ -8,7 +8,7 @@
   package org.apache.excalibur.containerkit.kernel;
   
   import org.apache.excalibur.containerkit.lifecycle.impl.AbstractResourceProvider;
  -import org.apache.excalibur.containerkit.metadata.ComponentPolicy;
  +import org.apache.excalibur.containerkit.metadata.ComponentProfile;
   import org.apache.excalibur.containerkit.metainfo.ComponentInfo;
   import org.apache.excalibur.containerkit.metainfo.ComponentDescriptor;
   import org.apache.avalon.framework.logger.Logger;
  @@ -29,9 +29,9 @@
           m_serviceKernel = serviceKernel;
       }
   
  -    protected ComponentPolicy getMetaData( Object entry )
  +    protected ComponentProfile getProfile( Object entry )
       {
  -        return ( (ComponentEntry)entry ).getMetaData();
  +        return ( (ComponentEntry)entry ).getProfile();
       }
   
       protected Object getService( final String name,
  @@ -50,7 +50,7 @@
       public Object createObject( final Object entry )
           throws Exception
       {
  -        final ComponentPolicy component = getMetaData( entry );
  +        final ComponentProfile component = getProfile( entry );
           final ComponentInfo info = component.getComponentInfo();
           final ComponentDescriptor descriptor = info.getComponentDescriptor();
           final String implementationKey = descriptor.getImplementationKey();
  @@ -61,7 +61,7 @@
       public Logger createLogger( final Object entry )
           throws Exception
       {
  -        final ComponentPolicy component = getMetaData( entry );
  +        final ComponentProfile component = getProfile( entry );
           return getLogger().getChildLogger( component.getName() );
       }
   }
  
  
  
  1.5       +11 -11    jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/SimpleServiceKernel.java
  
  Index: SimpleServiceKernel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/SimpleServiceKernel.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SimpleServiceKernel.java	6 Jul 2002 00:58:38 -0000	1.4
  +++ SimpleServiceKernel.java	6 Jul 2002 01:13:01 -0000	1.5
  @@ -15,7 +15,7 @@
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.excalibur.containerkit.infobuilder.ComponentInfoBuilder;
   import org.apache.excalibur.containerkit.lifecycle.ResourceProvider;
  -import org.apache.excalibur.containerkit.metadata.ComponentPolicy;
  +import org.apache.excalibur.containerkit.metadata.ComponentProfile;
   import org.apache.excalibur.containerkit.metadata.Association;
   import org.apache.excalibur.containerkit.metainfo.ComponentInfo;
   
  @@ -79,26 +79,26 @@
           final Configuration config = component.getChild( "config" );
           final ComponentInfo info = getComponentInfo( impl );
           final Association[] dependencies =
  -            parseDependencies( component.getChildren( "provide" ) );
  +            parseAssociations( component.getChildren( "provide" ) );
   
  -        final ComponentPolicy metaData =
  -            new ComponentPolicy( name, dependencies, null, config, info );
  -        addComponent( metaData );
  +        final ComponentProfile profile =
  +            new ComponentProfile( name, dependencies, null, config, info );
  +        addComponent( profile );
       }
   
  -    private Association[] parseDependencies( final Configuration[] provides )
  +    private Association[] parseAssociations( final Configuration[] provides )
           throws ConfigurationException
       {
  -        final ArrayList dependencies = new ArrayList();
  +        final ArrayList associations = new ArrayList();
           for( int i = 0; i < provides.length; i++ )
           {
               final Configuration provide = provides[ i ];
               final String role = provide.getAttribute( "role" );
               final String provider = provide.getAttribute( "name" );
  -            final Association metaData = new Association( role, provider );
  -            dependencies.add( metaData );
  +            final Association association = new Association( role, provider );
  +            associations.add( association );
           }
  -        return (Association[])dependencies.toArray( new Association[ dependencies.size() ] );
  +        return (Association[])associations.toArray( new Association[ associations.size() ] );
       }
   
       private ComponentInfo getComponentInfo( final String impl )
  
  
  
  1.10      +11 -11    jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/lifecycle/impl/AbstractResourceProvider.java
  
  Index: AbstractResourceProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/lifecycle/impl/AbstractResourceProvider.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- AbstractResourceProvider.java	6 Jul 2002 00:58:38 -0000	1.9
  +++ AbstractResourceProvider.java	6 Jul 2002 01:13:01 -0000	1.10
  @@ -23,7 +23,7 @@
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.excalibur.containerkit.lifecycle.ResourceProvider;
  -import org.apache.excalibur.containerkit.metadata.ComponentPolicy;
  +import org.apache.excalibur.containerkit.metadata.ComponentProfile;
   import org.apache.excalibur.containerkit.metadata.Association;
   import org.apache.excalibur.containerkit.metainfo.ComponentInfo;
   import org.apache.excalibur.containerkit.metainfo.ContextDescriptor;
  @@ -85,7 +85,7 @@
       public Parameters createParameters( Object entry )
           throws Exception
       {
  -        final ComponentPolicy component = getMetaData( entry );
  +        final ComponentProfile component = getProfile( entry );
           final Parameters parameters = component.getParameters();
           if( null == parameters )
           {
  @@ -108,7 +108,7 @@
       public Configuration createConfiguration( Object entry )
           throws Exception
       {
  -        final ComponentPolicy component = getMetaData( entry );
  +        final ComponentProfile component = getProfile( entry );
           final Configuration configuration = component.getConfiguration();
           if( null == configuration )
           {
  @@ -136,16 +136,16 @@
       }
   
       /**
  -     * Return the {@link ComponentPolicy} for specified component entry.
  -     * This implementation assumes that entry is instance of {@link org.apache.excalibur.containerkit.metadata.ComponentPolicy}
  +     * Return the {@link ComponentProfile} for specified component entry.
  +     * This implementation assumes that entry is instance of {@link org.apache.excalibur.containerkit.metadata.ComponentProfile}
        * but subclasses should overide this method if this assumption does not hold true.
        *
        * @param entry the component entry
  -     * @return the ComponentMetaData
  +     * @return the ComponentProfile
        */
  -    protected ComponentPolicy getMetaData( final Object entry )
  +    protected ComponentProfile getProfile( final Object entry )
       {
  -        return (ComponentPolicy)entry;
  +        return (ComponentProfile)entry;
       }
   
       /**
  @@ -158,7 +158,7 @@
       public final Context createContext( final Object componentEntry )
           throws Exception
       {
  -        final ComponentPolicy component = getMetaData( componentEntry );
  +        final ComponentProfile component = getProfile( componentEntry );
           final String componentName = component.getName();
   
           final ContextDescriptor descriptor =
  @@ -306,7 +306,7 @@
       private Map createServiceMap( final Object componentEntry )
           throws Exception
       {
  -        final ComponentPolicy component = getMetaData( componentEntry );
  +        final ComponentProfile component = getProfile( componentEntry );
           final ComponentInfo info = component.getComponentInfo();
           final Association[] dependencies = component.getDependencies();
   
  
  
  
  1.2       +10 -9     jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metadata/Association.java
  
  Index: Association.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metadata/Association.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Association.java	6 Jul 2002 00:58:38 -0000	1.1
  +++ Association.java	6 Jul 2002 01:13:01 -0000	1.2
  @@ -8,10 +8,11 @@
   package org.apache.excalibur.containerkit.metadata;
   
   /**
  - * The DependencyMetaData is the mapping of a component as a dependency
  - * of another component. Each component declares dependencies (via ComponentInfo)
  + * The {@link Association} is the mapping of a component as a dependency
  + * of another component. Each component declares dependencies (via
  + * {@link org.apache.excalibur.containerkit.metainfo.ComponentInfo})
    * and for each dependency there must be a coressponding DependencyMetaData which
  - * has a matching role. The name value in DependencyMetaData object must refer
  + * has a matching role. The name value in {@link Association} object must refer
    * to another Component that implements a service as specified in DependencyInfo.
    *
    * <p>Note that it is invalid to have circular dependencies.</p>
  @@ -28,20 +29,20 @@
       private final String m_role;
   
       /**
  -     * the name of the component metadata instance that represents a component
  +     * the name of the component profile that represents a component
        * type that is capable of fullfilling the dependency.
        */
       private final String m_providerName;
   
       /**
  -     * Create MetaData with specified name and role.
  +     * Create Association between role and provider.
        *
        * @param role the name client uses to access component
  -     * @param providerName the name of <code>ComponentMetaData</code> instance
  +     * @param providerName the name of {@link ComponentProfile}
        *   that is associated as a service provider
        */
       public Association( final String role,
  -                               final String providerName )
  +                        final String providerName )
       {
           m_role = role;
           m_providerName = providerName;
  @@ -60,7 +61,7 @@
       }
   
       /**
  -     * Return the name of a <code>ComponentMetaData</code> instance that will used to
  +     * Return the name of a {@link ComponentProfile} instance that will used to
        * fulfill the dependency.
        *
        * @return the name of the Component that will provide the dependency.
  
  
  
  1.2       +1 -1      jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metadata/package.html
  
  Index: package.html
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metadata/package.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- package.html	18 Jun 2002 10:52:24 -0000	1.1
  +++ package.html	6 Jul 2002 01:13:01 -0000	1.2
  @@ -1,5 +1,5 @@
   
   <body>
   A set of classes supporting the representation of information about a
  -component type usage.
  +component profile.
   </body>
  
  
  
  1.1                  jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metadata/ComponentProfile.java
  
  Index: ComponentProfile.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.containerkit.metadata;
  
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.excalibur.containerkit.metainfo.ComponentInfo;
  
  /**
   * Each component declared in the application is represented by
   * a ComponentPolicy. Note that this does not necessarily imply
   * that there is only one instance of actual component. The
   * ComponentProfile could represent a pool of components, a single
   * component or a component prototype that is reused to create
   * new components as needed.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
   * @version $Revision: 1.1 $ $Date: 2002/07/06 01:13:01 $
   */
  public class ComponentProfile
  {
      /**
       * The name of the component profile. This is an
       * abstract name used during assembly.
       */
      private final String m_name;
  
      /**
       * The resolution of any dependencies required by
       * the component type.
       */
      private final Association[] m_dependencies;
  
      /**
       * The info object for component type.
       */
      private final ComponentInfo m_componentInfo;
  
      /**
       * The parameters for component (if any).
       */
      private final Parameters m_parameters;
  
      /**
       * The configuration for component (if any).
       */
      private final Configuration m_configuration;
  
      /**
       * Create a ComponentPolicy.
       *
       * @param name the abstract name of component meta data instance
       * @param dependencies the meta data for any dependencies
       * @param componentInfo the component componentInfo desribing the component type
       */
      public ComponentProfile( final String name,
                                final Association[] dependencies,
                                final Parameters parameters,
                                final Configuration configuration,
                                final ComponentInfo componentInfo )
      {
          if( null == name )
          {
              throw new NullPointerException( "name" );
          }
          if( null == dependencies )
          {
              throw new NullPointerException( "dependencies" );
          }
          if( null == componentInfo )
          {
              throw new NullPointerException( "componentInfo" );
          }
  
          m_name = name;
          m_dependencies = dependencies;
          m_parameters = parameters;
          m_configuration = configuration;
          m_componentInfo = componentInfo;
      }
  
      /**
       * Return the name of component profile.
       *
       * @return the name of the component profile.
       */
      public String getName()
      {
          return m_name;
      }
  
      /**
       * Return the info for component.
       *
       * @return the info for component type.
       */
      public ComponentInfo getComponentInfo()
      {
          return m_componentInfo;
      }
  
      /**
       * Return the dependency for component.
       *
       * @return the dependency for component.
       */
      public Association[] getDependencies()
      {
          return m_dependencies;
      }
  
      /**
       * Return the Parameters for Component (if any).
       *
       * @return the Parameters for Component (if any).
       */
      public Parameters getParameters()
      {
          return m_parameters;
      }
  
      /**
       * Return the Configuration for Component (if any).
       *
       * @return the Configuration for Component (if any).
       */
      public Configuration getConfiguration()
      {
          return m_configuration;
      }
  
      /**
       * Return the dependency for component with specified role.
       *
       * @return the dependency for component with specified role.
       */
      public Association getDependency( final String role )
      {
          for( int i = 0; i < m_dependencies.length; i++ )
          {
              if( m_dependencies[ i ].getRole().equals( role ) )
              {
                  return m_dependencies[ i ];
              }
          }
  
          return null;
      }
  }
  
  
  
  1.26      +35 -35    jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/verifier/AssemblyVerifier.java
  
  Index: AssemblyVerifier.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/verifier/AssemblyVerifier.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- AssemblyVerifier.java	6 Jul 2002 00:58:39 -0000	1.25
  +++ AssemblyVerifier.java	6 Jul 2002 01:13:01 -0000	1.26
  @@ -12,7 +12,7 @@
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  -import org.apache.excalibur.containerkit.metadata.ComponentPolicy;
  +import org.apache.excalibur.containerkit.metadata.ComponentProfile;
   import org.apache.excalibur.containerkit.metadata.Association;
   import org.apache.excalibur.containerkit.metainfo.ComponentInfo;
   import org.apache.excalibur.containerkit.metainfo.DependencyDescriptor;
  @@ -60,7 +60,7 @@
        * @param components the Components that make up assembly
        * @throws VerifyException if an error occurs
        */
  -    public void verifyAssembly( final ComponentPolicy[] components )
  +    public void verifyAssembly( final ComponentProfile[] components )
           throws VerifyException
       {
           String message = null;
  @@ -89,10 +89,10 @@
       /**
        * Verfiy that all Components have the needed dependencies specified correctly.
        *
  -     * @param components the ComponentMetaData objects for the components
  +     * @param components the ComponentProfile objects for the components
        * @throws VerifyException if an error occurs
        */
  -    public void verifyValidDependencies( final ComponentPolicy[] components )
  +    public void verifyValidDependencies( final ComponentProfile[] components )
           throws VerifyException
       {
           for( int i = 0; i < components.length; i++ )
  @@ -104,15 +104,15 @@
       /**
        * Verfiy that there are no circular references between Components.
        *
  -     * @param components the ComponentMetaData objects for the components
  +     * @param components the ComponentProfile objects for the components
        * @throws VerifyException if an circular dependency error occurs
        */
  -    protected void verifyNoCircularDependencies( final ComponentPolicy[] components )
  +    protected void verifyNoCircularDependencies( final ComponentProfile[] components )
           throws VerifyException
       {
           for( int i = 0; i < components.length; i++ )
           {
  -            final ComponentPolicy component = components[ i ];
  +            final ComponentProfile component = components[ i ];
   
               final Stack stack = new Stack();
               stack.push( component );
  @@ -125,19 +125,19 @@
        * Verfiy that there are no circular references between Components.
        *
        * @param component ???
  -     * @param components the ComponentMetaData objects for the components
  +     * @param components the ComponentProfile objects for the components
        * @param stack the ???
        * @throws VerifyException if an error occurs
        */
  -    protected void verifyNoCircularDependencies( final ComponentPolicy component,
  -                                                 final ComponentPolicy[] components,
  +    protected void verifyNoCircularDependencies( final ComponentProfile component,
  +                                                 final ComponentProfile[] components,
                                                    final Stack stack )
           throws VerifyException
       {
  -        final ComponentPolicy[] dependencies = getDependencies( component, components );
  +        final ComponentProfile[] dependencies = getDependencies( component, components );
           for( int i = 0; i < dependencies.length; i++ )
           {
  -            final ComponentPolicy dependency = dependencies[ i ];
  +            final ComponentProfile dependency = dependencies[ i ];
               if( stack.contains( dependency ) )
               {
                   final String trace = getDependencyTrace( dependency, stack );
  @@ -162,7 +162,7 @@
        * @param stack the Stack
        * @return the path of dependency
        */
  -    protected String getDependencyTrace( final ComponentPolicy component,
  +    protected String getDependencyTrace( final ComponentProfile component,
                                            final Stack stack )
       {
           final StringBuffer sb = new StringBuffer();
  @@ -173,7 +173,7 @@
           final int top = size - 1;
           for( int i = top; i >= 0; i-- )
           {
  -            final ComponentPolicy other = (ComponentPolicy)stack.get( i );
  +            final ComponentProfile other = (ComponentProfile)stack.get( i );
               if( top != i )
               {
                   sb.append( ", " );
  @@ -201,8 +201,8 @@
        * @param components the total set of components in application
        * @return the dependencies of component
        */
  -    protected ComponentPolicy[] getDependencies( final ComponentPolicy component,
  -                                                   final ComponentPolicy[] components )
  +    protected ComponentProfile[] getDependencies( final ComponentProfile component,
  +                                                   final ComponentProfile[] components )
       {
           final ArrayList dependencies = new ArrayList();
           final Association[] deps = component.getDependencies();
  @@ -210,20 +210,20 @@
           for( int i = 0; i < deps.length; i++ )
           {
               final String name = deps[ i ].getProviderName();
  -            final ComponentPolicy other = getComponentMetaData( name, components );
  +            final ComponentProfile other = getComponentProfile( name, components );
               dependencies.add( other );
           }
   
  -        return (ComponentPolicy[])dependencies.toArray( new ComponentPolicy[ 0 ] );
  +        return (ComponentProfile[])dependencies.toArray( new ComponentProfile[ 0 ] );
       }
   
       /**
        * Verfiy that the inter-Component dependencies are valid.
        *
  -     * @param components the ComponentMetaData objects for the components
  +     * @param components the ComponentProfile objects for the components
        * @throws VerifyException if an error occurs
        */
  -    protected void verifyDependencyReferences( final ComponentPolicy[] components )
  +    protected void verifyDependencyReferences( final ComponentProfile[] components )
           throws VerifyException
       {
           for( int i = 0; i < components.length; i++ )
  @@ -235,12 +235,12 @@
       /**
        * Verfiy that the inter-Component dependencies are valid for specified Component.
        *
  -     * @param component the ComponentMetaData object for the component
  -     * @param others the ComponentMetaData objects for the other components
  +     * @param component the ComponentProfile object for the component
  +     * @param others the ComponentProfile objects for the other components
        * @throws VerifyException if an error occurs
        */
  -    protected void verifyDependencyReferences( final ComponentPolicy component,
  -                                               final ComponentPolicy[] others )
  +    protected void verifyDependencyReferences( final ComponentProfile component,
  +                                               final ComponentProfile[] others )
           throws VerifyException
       {
           final ComponentInfo info = component.getComponentInfo();
  @@ -254,7 +254,7 @@
                   info.getDependency( roleName ).getService();
   
               //Get the other component that is providing service
  -            final ComponentPolicy provider = getComponentMetaData( providerName, others );
  +            final ComponentProfile provider = getComponentProfile( providerName, others );
               if( null == provider )
               {
                   final String message =
  @@ -287,8 +287,8 @@
        * @param components the array of components to search
        * @return the Component if found, else null
        */
  -    protected ComponentPolicy getComponentMetaData( final String name,
  -                                                      final ComponentPolicy[] components )
  +    protected ComponentProfile getComponentProfile( final String name,
  +                                                      final ComponentProfile[] components )
       {
           for( int i = 0; i < components.length; i++ )
           {
  @@ -304,10 +304,10 @@
       /**
        * Verify that the names of the specified Components are valid.
        *
  -     * @param components the Components metadata
  +     * @param components the Components Profile
        * @throws VerifyException if an error occurs
        */
  -    protected void verifyValidNames( final ComponentPolicy[] components )
  +    protected void verifyValidNames( final ComponentProfile[] components )
           throws VerifyException
       {
           for( int i = 0; i < components.length; i++ )
  @@ -352,7 +352,7 @@
        * @param components the Components
        * @throws VerifyException if an error occurs
        */
  -    protected void checkNamesUnique( final ComponentPolicy[] components )
  +    protected void checkNamesUnique( final ComponentProfile[] components )
           throws VerifyException
       {
           for( int i = 0; i < components.length; i++ )
  @@ -370,7 +370,7 @@
        * @param index the index of component in array (so we can skip it)
        * @throws VerifyException if names are not unique
        */
  -    private void verifyUniqueName( final ComponentPolicy[] components,
  +    private void verifyUniqueName( final ComponentProfile[] components,
                                      final String name,
                                      final int index )
           throws VerifyException
  @@ -388,14 +388,14 @@
       }
   
       /**
  -     * Retrieve a list of DependencyMetaData objects for ComponentMetaData
  +     * Retrieve a list of Association objects for ComponentProfile
        * and verify that there is a 1 to 1 map with dependencies specified
        * in ComponentInfo.
        *
  -     * @param component the ComponentMetaData describing the component
  +     * @param component the ComponentProfile describing the component
        * @throws VerifyException if an error occurs
        */
  -    protected void verifyDependenciesMap( final ComponentPolicy component )
  +    protected void verifyDependenciesMap( final ComponentProfile component )
           throws VerifyException
       {
           //Make sure all role entries specified in config file are valid
  
  
  
  1.7       +19 -18    jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/verifier/MetaDataVerifier.java
  
  Index: MetaDataVerifier.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/verifier/MetaDataVerifier.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MetaDataVerifier.java	6 Jul 2002 00:58:39 -0000	1.6
  +++ MetaDataVerifier.java	6 Jul 2002 01:13:02 -0000	1.7
  @@ -14,7 +14,7 @@
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.service.Serviceable;
  -import org.apache.excalibur.containerkit.metadata.ComponentPolicy;
  +import org.apache.excalibur.containerkit.metadata.ComponentProfile;
   import org.apache.excalibur.containerkit.metainfo.ComponentInfo;
   import org.apache.excalibur.containerkit.metainfo.ContextDescriptor;
   import org.apache.excalibur.containerkit.metainfo.ServiceDescriptor;
  @@ -23,7 +23,7 @@
   /**
    * This Class verifies that an implementation is valid wrt the
    * ComponentMetaData. It performs a number of checks to make sure
  - * that the implementation class is consistent with MetaData.
  + * that the implementation class is consistent with ComponentProfile.
    * Some of the checks it performs include;
    *
    * <ul>
  @@ -77,16 +77,17 @@
           super.enableLogging( logger );
           setupLogger( m_verifier );
       }
  +
       /**
        * Verfiy that specified components designate classes that implement the
  -     * advertised interfaces. And confrorm to expectations of MetaData.
  +     * advertised interfaces. And confrorm to expectations of {@link ComponentProfile}.
        *
  -     * @param component the ComponentMetaData object for the components
  +     * @param component the {@link ComponentProfile} object for the components
        * @param classLoader the ClassLoader to load component from
        * @throws VerifyException if an error occurs
        */
  -    public void verifyType( final ComponentPolicy component,
  -                               final ClassLoader classLoader )
  +    public void verifyType( final ComponentProfile component,
  +                            final ClassLoader classLoader )
           throws VerifyException
       {
           final Class clazz = getClass( classLoader, component );
  @@ -95,13 +96,13 @@
   
       /**
        * Verfiy that specified components designate classes that implement the
  -     * advertised interfaces. And confrorm to expectations of MetaData.
  +     * advertised interfaces. And confrorm to expectations of {@link ComponentProfile}.
        *
  -     * @param component the ComponentMetaData object for the components
  +     * @param component the {@link ComponentProfile} object for the components
        * @throws VerifyException if an error occurs
        */
  -    public void verifyType( final ComponentPolicy component,
  -                               final Class clazz )
  +    public void verifyType( final ComponentProfile component,
  +                            final Class clazz )
           throws VerifyException
       {
           final String name = component.getName();
  @@ -120,11 +121,11 @@
        * Verify that the if  the component is not Contextualizable that it
        * does not declare Context Entrys.
        *
  -     * @param component the component metadata
  +     * @param component the {@link ComponentProfile}
        * @param clazz the class implementing component
        * @throws VerifyException if fails verification check
        */
  -    protected void verifyContextPresence( final ComponentPolicy component,
  +    protected void verifyContextPresence( final ComponentProfile component,
                                             final Class clazz )
           throws VerifyException
       {
  @@ -152,11 +153,11 @@
        * <p>or</p>
        * <p>Is Composable/Serviceable and does declare dependencys</p>
        *
  -     * @param component the component metadata
  +     * @param component the {@link ComponentProfile}
        * @param clazz the class implementing component
        * @throws VerifyException if fails verification check
        */
  -    protected void verifyDependencyPresence( final ComponentPolicy component,
  +    protected void verifyDependencyPresence( final ComponentProfile component,
                                                final Class clazz )
           throws VerifyException
       {
  @@ -217,7 +218,7 @@
       }
   
       /**
  -     * Load class object for specified ComponentMetaData.
  +     * Load class object for specified {@link ComponentProfile}.
        *
        * @param classLoader the ClassLoader to use
        * @param component the meta data associate with component
  @@ -225,7 +226,7 @@
        * @throws VerifyException if unable to aquire class object
        */
       private Class getClass( final ClassLoader classLoader,
  -                            final ComponentPolicy component )
  +                            final ComponentProfile component )
           throws VerifyException
       {
           Class clazz = null;
  @@ -251,7 +252,7 @@
        * @param component the component
        * @return the classname for component
        */
  -    private String getClassname( final ComponentPolicy component )
  +    private String getClassname( final ComponentProfile component )
       {
           return component.getComponentInfo().getComponentDescriptor().getImplementationKey();
       }
  
  
  

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