use of org.osgi.framework.AdaptPermission in project logging-log4j2 by apache.
the class Activator method loadProvider.
private void loadProvider(final Bundle bundle) {
if (bundle.getState() == Bundle.UNINSTALLED) {
return;
}
try {
checkPermission(new AdminPermission(bundle, AdminPermission.RESOURCE));
checkPermission(new AdaptPermission(BundleWiring.class.getName(), bundle, AdaptPermission.ADAPT));
loadProvider(bundle.adapt(BundleWiring.class));
} catch (final SecurityException e) {
LOGGER.debug("Cannot access bundle [{}] contents. Ignoring.", bundle.getSymbolicName(), e);
} catch (final Exception e) {
LOGGER.warn("Problem checking bundle {} for Log4j 2 provider.", bundle.getSymbolicName(), e);
}
}
Aggregations