You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2002/07/07 06:31:01 UTC

cvs commit: jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/meta/data Association.java

mcconnell    2002/07/06 21:31:01

  Added:       assembly/src/java/org/apache/excalibur/meta/data
                        Association.java
  Log:
  was Assignment.java (renamed to Association for API clarity)
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/meta/data/Association.java
  
  Index: Association.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.meta.data;
  
  
  
  /**
   * The Association is the mapping of a component as a dependency
   * of another component. Each component declares dependencies (via Type)
   * and for each dependency there must be a coressponding Association which
   * has a matching role. The name value in 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>
   *
   * @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/07 04:31:01 $
   */
  public final class Association
  {
      /**
       * The name that the client component will use to access a dependency.
       */
      private final String m_role;
  
      /**
       * the name of the component metadata instance that represents a component
       * type that is capable of fullfilling the dependency.
       */
      private final Profile m_provider;
  
      /**
       * Create Profile with specified name and role.
       *
       * @param role the name client uses to access component
       * @param providerName the name of <code>ComponentProfile</code> instance
       *   that is associated as a service provider
       */
      public Association( final String role,
                                 final Profile provider )
      {
          m_role = role;
          m_provider = provider;
      }
  
      /**
       * Return the name that will be used by a component instance to access a
       * dependent service.
       *
       * @return the name that the client component will use to access dependency.
       * @see org.apache.avalon.framework.service.ServiceManager#lookup( String )
       */
      public String getRole()
      {
          return m_role;
      }
  
      /**
       * Return the name of a <code>ComponentProfile</code> instance that will used to
       * fulfill the dependency.
       *
       * @return the name of the Component that will provide the dependency.
       */
      public Profile getProvider()
      {
          return m_provider;
      }
  }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>