View Javadoc

1   package com.atlassian.plugin.spring;
2   
3   import com.atlassian.plugin.osgi.hostcomponents.ContextClassLoaderStrategy;
4   
5   import java.util.Collections;
6   import java.util.Map;
7   import java.util.Set;
8   
9   /**
10   * Offers configurations for SpringHostComponentProvider.
11   */
12  public class SpringHostComponentProviderConfig
13  {
14      /**
15       * A set of bean names to make available to plugins
16       */
17      private Set<String> beanNames = Collections.emptySet();
18  
19      /**
20       * Mapping of beanNames to the interfaces it should be exposed as. Note that if a bean name is present an no interface
21       * is defined then all its interfaces should be 'exposed'.
22       */
23      private Map<String, Class[]> beanInterfaces = Collections.emptyMap();
24  
25      /**
26       * Mapping of beanNames with their {@link com.atlassian.plugin.osgi.hostcomponents.ContextClassLoaderStrategy}.
27       * Default value is {@link com.atlassian.plugin.osgi.hostcomponents.ContextClassLoaderStrategy#USE_HOST}.
28       */
29      private Map<String, ContextClassLoaderStrategy> beanContextClassLoaderStrategies = Collections.emptyMap();
30  
31      /**
32       * Whether or not to scan for {@link com.atlassian.plugin.spring.AvailableToPlugins} annotations on beans defined in the bean factory, defaults to {@code false}.
33       */
34      private boolean useAnnotation = false;
35  
36  
37      public Set<String> getBeanNames() {
38          return beanNames;
39      }
40  
41      public void setBeanNames(Set<String> beanNames) {
42          this.beanNames = beanNames;
43      }
44  
45      public Map<String, Class[]> getBeanInterfaces() {
46          return beanInterfaces;
47      }
48  
49      public void setBeanInterfaces(Map<String, Class[]> beanInterfaces) {
50          this.beanInterfaces = beanInterfaces;
51      }
52  
53      public Map<String, ContextClassLoaderStrategy> getBeanContextClassLoaderStrategies() {
54          return beanContextClassLoaderStrategies;
55      }
56  
57      public void setBeanContextClassLoaderStrategies(Map<String, ContextClassLoaderStrategy> beanContextClassLoaderStrategies) {
58          this.beanContextClassLoaderStrategies = beanContextClassLoaderStrategies;
59      }
60  
61      public void setUseAnnotation(boolean useAnnotation)
62      {
63          this.useAnnotation = useAnnotation;
64      }
65  
66      public boolean isUseAnnotation()
67      {
68          return useAnnotation;
69      }
70  }