BundleContext context = getInstanceManager().getContext(); // Get the default bundle context.
if (scope != null) {
// If we are not in a composite, the policy is set to global.
if (scope.equalsIgnoreCase("global") || ((((IPojoContext) getInstanceManager().getContext()).getServiceContext()) == null)) {
context =
new PolicyServiceContext(getInstanceManager().getGlobalContext(), getInstanceManager().getLocalServiceContext(),
PolicyServiceContext.GLOBAL);
} else if (scope.equalsIgnoreCase("composite")) {
context =
new PolicyServiceContext(getInstanceManager().getGlobalContext(), getInstanceManager().getLocalServiceContext(),
PolicyServiceContext.LOCAL);
} else if (scope.equalsIgnoreCase("composite+global")) {
context =
new PolicyServiceContext(getInstanceManager().getGlobalContext(), getInstanceManager().getLocalServiceContext(),
PolicyServiceContext.LOCAL_AND_GLOBAL);
}
}
// Get instance filter if available