View Javadoc

1   /*
2    * Copyright 2006-2008 the original author or authors.
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  
17  package org.springframework.osgi.io.internal.resolver;
18  
19  import org.osgi.framework.Bundle;
20  import org.osgi.service.packageadmin.PackageAdmin;
21  
22  /**
23   * Simple interface offering utility methods for OSGi dependencies, mainly
24   * bundles. This class suplements the {@link PackageAdmin} service by offering
25   * information on importing, not just exporting.
26   * 
27   * @author Costin Leau
28   */
29  public interface DependencyResolver {
30  
31  	/**
32  	 * Returns the bundles imported by the given bundle. It's up to the
33  	 * implementation to consider required bundles, bundle class-path and
34  	 * dynamic imports.
35  	 * 
36  	 * <p/> The returned array should not contain duplicates (each imported
37  	 * bundle should be present exactly once).
38  	 * 
39  	 * <p/> In general it is not expected to have knowledge about runtime
40  	 * loading (such as dynamic imports).
41  	 * 
42  	 * @param bundle OSGi bundle for which imported bundles will be determined
43  	 * @return a not-null array of importing bundles
44  	 */
45  	ImportedBundle[] getImportedBundles(Bundle bundle);
46  }