1 /* 2 * Copyright 2007 Joachim Grueneis 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package org.exolab.castor.xml.util; 17 18 import java.util.Map; 19 20 import org.exolab.castor.xml.ResolverException; 21 22 /** 23 * A command used by a resolver strategy to get class descriptors for a package. 24 * The number of class descriptors returned will vary between zero and many... 25 * Commands are planned to be something like a service which might get invoked 26 * multiple times in parallel. So no resolve specific states are allowed to be 27 * stored in the class state! 28 * 29 * @author <a href="mailto:jgrueneis AT gmail DOT com">Joachim Grueneis</a> 30 * @version $Revision$ $Date$ 31 * @since 1.2 32 */ 33 public interface ResolverPackageCommand { 34 /** 35 * The one and only purpose resolver commands are good for ;-) . Resolving 36 * the package giving and returning (a maybe empty) list of descriptors found. 37 * The descriptors are put into a Map of String (className) and Class (descriptor 38 * class). 39 * 40 * @param packageName the name of the package to resolve 41 * @param p the Properties to be used at resolve 42 * @return a Map of className and XMLClassDescriptor 43 * @throws IllegalArgumentException if package name is null or empty 44 * @throws ResolverException in case that resolving fails fatally 45 */ 46 public Map resolve(String packageName, Map p) 47 throws ResolverException; 48 }