// update the cluster map
ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
try {
Map<String, BundleState> bundles = clusterManager.getMap(Constants.BUNDLE_MAP + Configurations.SEPARATOR + groupName);
BundleState state = bundles.get(symbolicName + "/" + version);
if (state == null) {
throw new IllegalStateException("Bundle " + symbolicName + "/" + version + " not found in cluster group " + groupName);
}
String location = state.getLocation();
// check if the bundle location is allowed
CellarSupport support = new CellarSupport();
support.setClusterManager(this.clusterManager);
support.setGroupManager(this.groupManager);
support.setConfigurationAdmin(this.configurationAdmin);
if (!support.isAllowed(group, Constants.CATEGORY, location, EventType.OUTBOUND)) {
throw new IllegalArgumentException("Bundle location " + location + " is blocked outbound");
}
state.setStatus(BundleEvent.STARTED);
bundles.put(symbolicName + "/" + version, state);
} finally {
Thread.currentThread().setContextClassLoader(originalClassLoader);
}