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      private Set<String> bundleTrackingBeans = Collections.emptySet();
32  
33      /**
34       * Whether or not to scan for {@link com.atlassian.plugin.spring.AvailableToPlugins} annotations on beans defined in the bean factory, defaults to {@code false}.
35       */
36      private boolean useAnnotation = false;
37  
38  
39      public Set<String> getBeanNames()
40      {
41          return beanNames;
42      }
43  
44      @SuppressWarnings("unused")
45      public void setBeanNames(Set<String> beanNames)
46      {
47          this.beanNames = beanNames;
48      }
49  
50      public Map<String, Class[]> getBeanInterfaces()
51      {
52          return beanInterfaces;
53      }
54  
55      @SuppressWarnings("unused")
56      public void setBeanInterfaces(Map<String, Class[]> beanInterfaces)
57      {
58          this.beanInterfaces = beanInterfaces;
59      }
60  
61      public Map<String, ContextClassLoaderStrategy> getBeanContextClassLoaderStrategies()
62      {
63          return beanContextClassLoaderStrategies;
64      }
65  
66      @SuppressWarnings("unused")
67      public void setBeanContextClassLoaderStrategies(Map<String, ContextClassLoaderStrategy> beanContextClassLoaderStrategies)
68      {
69          this.beanContextClassLoaderStrategies = beanContextClassLoaderStrategies;
70      }
71  
72      public Set<String> getBundleTrackingBeans()
73      {
74          return bundleTrackingBeans;
75      }
76  
77      @SuppressWarnings("unused")
78      public void setBundleTrackingBeans(Set<String> bundleTrackingBeans)
79      {
80          this.bundleTrackingBeans = bundleTrackingBeans;
81      }
82  
83      public void setUseAnnotation(boolean useAnnotation)
84      {
85          this.useAnnotation = useAnnotation;
86      }
87  
88      public boolean isUseAnnotation()
89      {
90          return useAnnotation;
91      }
92  }