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 /**
10 * The name of the host component bean, usually the Spring bean identifier
11 */
12 String BEAN_NAME = "bean-name";
13
14 /**
15 * The context class loader strategy to use for managing the CCL when invoking host component methods
16 */
17 String CONTEXT_CLASS_LOADER_STRATEGY = "context-class-loader-strategy";
18
19 /**
20 * Whether the host component should track the bundle invoking component methods
21 *
22 * @see CallingBundleAccessor
23 */
24 String TRACK_BUNDLE = "track-bundle";
25
26 /**
27 * Sets the bean name of the host component
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 * @param strategy The strategy to use
36 * @return The property builder
37 */
38 PropertyBuilder withContextClassLoaderStrategy(ContextClassLoaderStrategy strategy);
39
40 /**
41 * Sets whether bundle tracking is enabled
42 *
43 * @param enabled {@code true} if tracking should be enabled, {@code false} otherwise
44 * @return The property builder
45 */
46 PropertyBuilder withTrackBundleEnabled(boolean enabled);
47
48 /**
49 * Sets an arbitrary property to register with the host component
50 * @param name The property name
51 * @param value The property value
52 * @return The property builder
53 */
54 PropertyBuilder withProperty(String name, String value);
55 }