1 package com.atlassian.plugin.spring;
2
3 import com.atlassian.plugin.osgi.hostcomponents.ContextClassLoaderStrategy;
4
5 import java.lang.annotation.Target;
6 import java.lang.annotation.ElementType;
7 import java.lang.annotation.Retention;
8 import java.lang.annotation.RetentionPolicy;
9
10 /**
11 * Annotation for Spring beans which are made available to OSGi plugin components
12 *
13 * If a Class is specified, then the bean is exposed only as that class -- otherwise it is exposed as all interfaces it implements.
14 */
15 @Target(ElementType.TYPE)
16 @Retention(RetentionPolicy.RUNTIME)
17 public @interface AvailableToPlugins
18 {
19 /**
20 * @return The interface the bean is to be exposed as.
21 */
22 Class value() default Void.class;
23
24 /**
25 * @return The interfaces the bean is to be exposed as. If declared together with {#value}, the result will be combined effect. However, it is highly recommended to use only one of them for clarity.
26 * @since 2.11.0
27 */
28 Class[] interfaces() default {};
29
30 /**
31 * @return The context class loader strategy to use when determine which CCL should be set when host component methods are invoked
32 */
33 ContextClassLoaderStrategy contextClassLoaderStrategy() default ContextClassLoaderStrategy.USE_HOST;
34
35 /**
36 * @return {@code true} if the component should track which bundle is accessing it. {@code false} otherwise
37 * @see com.atlassian.plugin.osgi.hostcomponents.CallingBundleAccessor
38 * @since 3.1.0
39 */
40 boolean trackBundle() default false;
41 }