View Javadoc
1   package com.atlassian.plugin.osgi.hostcomponents;
2   
3   /**
4    * Ties properties to the host component registration. Properties can be set via specific methods or generically
5    * via {@link #withProperty(String, String)}
6    */
7   public interface PropertyBuilder {
8       /**
9        * The name of the host component bean, usually the Spring bean identifier
10       */
11      String BEAN_NAME = "bean-name";
12  
13      /**
14       * The context class loader strategy to use for managing the CCL when invoking host component methods
15       */
16      String CONTEXT_CLASS_LOADER_STRATEGY = "context-class-loader-strategy";
17  
18      /**
19       * Whether the host component should track the bundle invoking component methods
20       *
21       * @see CallingBundleAccessor
22       */
23      String TRACK_BUNDLE = "track-bundle";
24  
25      /**
26       * Sets the bean name of the host component
27       *
28       * @param name The name
29       * @return The property builder
30       */
31      PropertyBuilder withName(String name);
32  
33      /**
34       * Sets the strategy to use for context classloader management
35       *
36       * @param strategy The strategy to use
37       * @return The property builder
38       */
39      PropertyBuilder withContextClassLoaderStrategy(ContextClassLoaderStrategy strategy);
40  
41      /**
42       * Sets whether bundle tracking is enabled
43       *
44       * @param enabled {@code true} if tracking should be enabled, {@code false} otherwise
45       * @return The property builder
46       */
47      PropertyBuilder withTrackBundleEnabled(boolean enabled);
48  
49      /**
50       * Sets an arbitrary property to register with the host component
51       *
52       * @param name  The property name
53       * @param value The property value
54       * @return The property builder
55       */
56      PropertyBuilder withProperty(String name, String value);
57  }