1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.osgi.extender.support.scanning;
18
19 import org.osgi.framework.Bundle;
20
21 /**
22 * Convenience scanner locating suitable Spring configurations inside an OSGi
23 * bundle. This interface can be implemented to customize Spring-DM default
24 * definition of a 'Spring-powered' bundle by using different locations or
25 * supplying defaults for bundles that do not provide a proper configuration.
26 *
27 * <p/> Additionally, non-XML configurations (for example annotation-based) can
28 * be plugged in. This would normally imply a custom application context creator
29 * as well.
30 *
31 * <p/><b>Note:</b>It is strongly recommended that the default locations (<tt>META-INF/spring/*.xml</tt>
32 * or <tt>Spring-Context</tt> manifest header) are supported (through chaining
33 * or by extending the default implementation) to avoid breaking bundles using
34 * them.
35 *
36 * <p/>This interface is intended for usage with the default
37 * {@link org.springframework.osgi.extender.OsgiApplicationContextCreator}
38 * implementation.
39 *
40 * @see org.springframework.osgi.extender.support.DefaultOsgiApplicationContextCreator
41 * @see org.springframework.osgi.extender.OsgiApplicationContextCreator
42 *
43 * @author Costin Leau
44 */
45 public interface ConfigurationScanner {
46
47 /**
48 * Returns an array of existing Spring configuration locations (as Strings)
49 * for the given bundle. If no resource was found, an empty/null array
50 * should be returned.
51 *
52 * @param bundle non-null bundle intended for scanning
53 * @return Spring configuration locations
54 */
55 String[] getConfigurations(Bundle bundle);
56 }