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 java.util.List; 20 21 import org.codehaus.plexus.component.repository.ComponentDescriptor; 22 23 /** 24 * @author Jason van Zyl 25 * @author <a href="mailto:mmaczka@interia.pl">Michal Maczka</a> 26 */ 27 public interface CompositionResolver { 28 public static final char SEPARATOR_CHAR = ':'; 29 30 /** 31 * @param componentDescriptor {@link ComponentDescriptor}. 32 * @throws CycleDetectedInComponentGraphException when cycle is detected 33 */ 34 void addComponentDescriptor(ComponentDescriptor<?> componentDescriptor) 35 throws CycleDetectedInComponentGraphException; 36 37 /** 38 * Returns the list of names of components which are required 39 * by the component of given role and roleHint. 40 * The names returned are in the form role:hint, where : is defined in SEPARATOR_CHAR. 41 * 42 * @param role The name of the component 43 * @param roleHint The implementation hint of the component 44 * @return The list of components which are required by given component 45 */ 46 List getRequirements(String role, String roleHint); 47 48 /** 49 * Returns the list of names of components which are using the component. 50 * of given role and roleHint. 51 * The names returned are in the form role:hint, where : is defined in SEPARATOR_CHAR. 52 * 53 * @param role The name of the component 54 * @param roleHint The implementation hint of the component 55 * @return The list of components which are requiring given component 56 */ 57 List findRequirements(String role, String roleHint); 58 }