Skip to content

Commit

Permalink
Merge pull request #7252 from jmesnil/WFLY-4423_CNFE_JMS_Bridge_stop_…
Browse files Browse the repository at this point in the history
…start
  • Loading branch information
stuartwdouglas committed Mar 16, 2015
2 parents bdaa0b8 + adfa4c5 commit f5c7cb3
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,20 @@ public void run() {
}

public void startBridge() throws Exception {
if (moduleName == null) {
bridge.start();
final Module module;
if (moduleName != null) {
ModuleIdentifier moduleID = ModuleIdentifier.create(moduleName);
module = Module.getContextModuleLoader().loadModule(moduleID);
} else {
ClassLoader oldTccl= WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
try {
ModuleIdentifier moduleID = ModuleIdentifier.create(moduleName);
Module module = Module.getCallerModuleLoader().loadModule(moduleID);
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(module.getClassLoader());
bridge.start();
} finally {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl);
}
module = Module.forClass(JMSBridgeService.class);
}

ClassLoader oldTccl= WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
try {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(module.getClassLoader());
bridge.start();
} finally {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl);
}
MessagingLogger.MESSAGING_LOGGER.startedService("JMS Bridge", bridgeName);
}
Expand Down

0 comments on commit f5c7cb3

Please sign in to comment.