View Javadoc
1   package org.codehaus.plexus.component.composition;
2   
3   /*
4    * Copyright 2001-2006 Codehaus Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  import org.codehaus.plexus.component.repository.ComponentDescriptor;
20  
21  import java.util.List;
22  
23  /**
24   * @author Jason van Zyl
25   * @author <a href="mailto:mmaczka@interia.pl">Michal Maczka</a>
26   * @version $Id$
27   */
28  public interface CompositionResolver
29  {
30      public static final char SEPARATOR_CHAR = ':';
31  
32      /**
33       * @param componentDescriptor
34       * @throws CycleDetectedInComponentGraphException when cycle is detected
35       */
36      void addComponentDescriptor( ComponentDescriptor<?> componentDescriptor ) 
37          throws CycleDetectedInComponentGraphException;
38  
39      /**
40       * Returns the list of names of components which are required
41       * by the component of given role and roleHint.
42       * The names returned are in the form role:hint, where : is defined in SEPARATOR_CHAR.
43       *
44       * @param role The name of the component
45       * @param roleHint The implementation hint of the component
46       * @return The list of components which are required by given component
47       */
48      List getRequirements( String role, String roleHint );
49  
50  
51      /**
52       * Returns the list of names of components which are using the component.
53       * of given role and roleHint.
54       * The names returned are in the form role:hint, where : is defined in SEPARATOR_CHAR.
55       *
56       * @param role The name of the component
57       * @param roleHint The implementation hint of the component
58       * @return The list of components which are requiring given component
59       */
60      List findRequirements( String role, String roleHint );
61  
62  
63  }