avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/verifier AssemblyVerifier.java
Date Sat, 08 Jun 2002 21:33:51 GMT
mcconnell    2002/06/08 14:33:51

  Modified:    containerkit/src/java/org/apache/excalibur/containerkit/metainfo
                        AbstractServiceDescriptor.java ComponentInfo.java
                        DependencyDescriptor.java ServiceDescriptor.java
               containerkit/src/java/org/apache/excalibur/containerkit/verifier
                        AssemblyVerifier.java
  Log:
  addition of reverse association between dependency -> componet info and service ->
component info
  
  Revision  Changes    Path
  1.2       +3 -3      jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/AbstractServiceDescriptor.java
  
  Index: AbstractServiceDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/AbstractServiceDescriptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractServiceDescriptor.java	7 Jun 2002 10:57:27 -0000	1.1
  +++ AbstractServiceDescriptor.java	8 Jun 2002 21:33:51 -0000	1.2
  @@ -18,19 +18,19 @@
    *
    * @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/06/07 10:57:27 $
  + * @version $Revision: 1.2 $ $Date: 2002/06/08 21:33:51 $
    */
   public abstract class AbstractServiceDescriptor
   {
       /**
        * The name of service class.
        */
  -    protected final String m_name;
  +    private final String m_name;
   
       /**
        * The version of service class.
        */
  -    protected final Version m_version;
  +    private final Version m_version;
   
       /**
        * Construct a service with specified name, version and attributes.
  
  
  
  1.4       +19 -1     jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentInfo.java
  
  Index: ComponentInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentInfo.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ComponentInfo.java	7 Jun 2002 02:22:17 -0000	1.3
  +++ ComponentInfo.java	8 Jun 2002 21:33:51 -0000	1.4
  @@ -23,7 +23,7 @@
    * </ul>
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.3 $ $Date: 2002/06/07 02:22:17 $
  + * @version $Revision: 1.4 $ $Date: 2002/06/08 21:33:51 $
    */
   public class ComponentInfo
   {
  @@ -97,6 +97,24 @@
               }
           }
   
  +        return null;
  +    }
  +
  +    /**
  +     * Retrieve a service matching the supplied name.
  +     *
  +     * @param name the service name
  +     * @return the service descriptor or null if it does not exist
  +     */
  +    public ServiceDescriptor getService( final String name )
  +    {
  +        for( int i = 0; i < m_services.length; i++ )
  +        {
  +            if( m_services[ i ].getName().equals( name ) )
  +            {
  +                return m_services[ i ];
  +            }
  +        }
           return null;
       }
   
  
  
  
  1.8       +33 -1     jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/DependencyDescriptor.java
  
  Index: DependencyDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/DependencyDescriptor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DependencyDescriptor.java	7 Jun 2002 11:11:26 -0000	1.7
  +++ DependencyDescriptor.java	8 Jun 2002 21:33:51 -0000	1.8
  @@ -33,7 +33,7 @@
    * demands.</p>
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.7 $ $Date: 2002/06/07 11:11:26 $
  + * @version $Revision: 1.8 $ $Date: 2002/06/08 21:33:51 $
    */
   public final class DependencyDescriptor
   {
  @@ -56,6 +56,12 @@
       private final Properties m_attributes;
   
       /**
  +     * A reference to the ComponentInfo instance that this descriptor
  +     * is contained by.
  +     */
  +     private ComponentInfo m_parent;
  +
  +    /**
        * Constructor a dependency sans Attributes.
        */
       public DependencyDescriptor( final String role,
  @@ -65,17 +71,30 @@
       }
   
       /**
  +     * Constructor that has all parts sans parent.
  +     */
  +    public DependencyDescriptor( final String role,
  +                                 final ServiceReference service,
  +                                 final Properties attributes )
  +    {
  +        this( role, service, null, null );
  +    }
  +
  +    /**
        * Constructor that has all parts as parameters.
        */
       public DependencyDescriptor( final String role,
                                    final ServiceReference service,
                                    final Properties attributes )
  +                                 final ComponentInfo parent )
       {
           m_role = role;
           m_service = service;
           m_attributes = attributes;
  +        m_parent = parent;
       }
   
  +
       /**
        * Return the name the component uses to lookup dependency.
        *
  @@ -149,4 +168,17 @@
               return (String[]) m_attributes.keySet().toArray( EMPTY_SET );
           }
       }
  +
  +    /**
  +     * Return the <code>ComponentInfo</code> instance that is the parent of

  +     * this dependency descriptor.
  +     *
  +     * @return the parent component info instance or null if undefined.
  +     */
  +    public ComponentInfo getParent()
  +    {
  +        return m_parent;
  +    }
  +
  +
   }
  
  
  
  1.9       +36 -1     jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ServiceDescriptor.java
  
  Index: ServiceDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ServiceDescriptor.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ServiceDescriptor.java	7 Jun 2002 11:11:26 -0000	1.8
  +++ ServiceDescriptor.java	8 Jun 2002 21:33:51 -0000	1.9
  @@ -30,7 +30,7 @@
    * upon to work in all containers.</p>
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.8 $ $Date: 2002/06/07 11:11:26 $
  + * @version $Revision: 1.9 $ $Date: 2002/06/08 21:33:51 $
    */
   public final class ServiceDescriptor extends AbstractServiceDescriptor
   {
  @@ -42,6 +42,12 @@
       private final Properties m_attributes;
   
       /**
  +     * A reference to the ComponentInfo instance that this descriptor
  +     * is contained by.
  +     */
  +     private ComponentInfo m_parent;
  +
  +    /**
        * Construct a service with specified name and version.
        *
        * @param name the name of the service
  @@ -63,8 +69,25 @@
                                 final Version version,
                                 final Properties attributes )
       {
  +        this( name, version, null, null );
  +    }
  +
  +    /**
  +     * Construct a service with specified name, version, attributes and parent.
  +     *
  +     * @param name the name of the service
  +     * @param version the version of service
  +     * @param attributes the attributes of service
  +     * @param parent the component info publishing this service
  +     */
  +    public ServiceDescriptor( final String name,
  +                              final Version version,
  +                              final Properties attributes,
  +                              final ComponentInfo parent )
  +    {
           super( name, version );
           m_attributes = attributes;
  +        m_parent = parent;
       }
   
       /**
  @@ -118,4 +141,16 @@
               return (String[]) m_attributes.keySet().toArray( EMPTY_SET );
           }
       }
  +
  +    /**
  +     * Return the <code>ComponentInfo</code> instance that is the parent of

  +     * this service descriptor.
  +     *
  +     * @return the parent component info instance or null if undefined.
  +     */
  +    public ComponentInfo getParent()
  +    {
  +        return m_parent;
  +    }
  +
   }
  
  
  
  1.8       +6 -4      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AssemblyVerifier.java	7 Jun 2002 01:47:41 -0000	1.7
  +++ AssemblyVerifier.java	8 Jun 2002 21:33:51 -0000	1.8
  @@ -45,7 +45,7 @@
    * </ul>
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.7 $ $Date: 2002/06/07 01:47:41 $
  + * @version $Revision: 1.8 $ $Date: 2002/06/08 21:33:51 $
    */
   public class AssemblyVerifier
       extends AbstractLogEnabled
  @@ -146,7 +146,7 @@
        * Verfiy that there are no circular references between Components.
        *
        * @param components the ComponentMetaData objects for the components
  -     * @throws VerifyException if an error occurs
  +     * @throws VerifyException if an circular dependency error occurs
        */
       protected void verifyNoCircularDependencies( final ComponentMetaData[] components )
           throws VerifyException
  @@ -165,7 +165,9 @@
       /**
        * Verfiy that there are no circular references between Components.
        *
  +     * @param component ???
        * @param components the ComponentMetaData objects for the components
  +     * @param stack the ???
        * @throws VerifyException if an error occurs
        */
       protected void verifyNoCircularDependencies( final ComponentMetaData component,
  @@ -569,11 +571,11 @@
       }
   
       /**
  -     * Return true if specified service matches any of the
  +     * Return true if specified service reference matches any of the
        * candidate services.
        *
  -     * @param candidates an array of candidate services
        * @param service the service descriptor reference
  +     * @param candidates an array of candidate services
        * @return true if candidate services contains a service that matches
        *         specified service, false otherwise
        */
  
  
  

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