ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
try {
// set TCCL to this module's CL
Thread.currentThread().setContextClassLoader(module.getClassLoader());
final RootContainer rootContainer = RootContainer.getInstance();
// register WSRP plugins service so that it's available when the WSRP service starts
rootContainer.registerComponentInstance(AS7Plugins.class, WSRPPostModuleDeploymentProcessor.plugins);
} finally {
if (Thread.currentThread().getContextClassLoader() != oldCl) {
Thread.currentThread().setContextClassLoader(oldCl);
}
}