1 package com.atlassian.plugin.osgi.hostcomponents;
2
3 import com.atlassian.plugin.osgi.hostcomponents.impl.CallingBundleStore;
4 import org.osgi.framework.Bundle;
5
6 /**
7 * An accessor to the bundle currently invoking a host component
8 *
9 * @since 3.1.0
10 */
11 public class CallingBundleAccessor {
12
13 /**
14 * @return the bundle currently invoking a host component, or {@code null} if the method call did not come from
15 * an OSGi bundle or tracking is not enabled.
16 */
17 public static Bundle getCallingBundle() {
18 return CallingBundleStore.get();
19 }
20 }