From b005770623eaf2a9015aa97a737c6e278abeba2d Mon Sep 17 00:00:00 2001 From: nash Date: Sat, 8 May 2010 21:02:07 +0000 Subject: Prevent bootstrap launcher from changing caller's classloader setting (TUSCANY-3551) git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@942470 13f79535-47bb-0310-9956-ffa450edef68 --- .../node/launcher/NodeImplementationDaemonBootstrap.java | 6 +----- .../node/launcher/NodeImplementationLauncherBootstrap.java | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'sca-java-1.x/trunk/modules/implementation-node-runtime/src') diff --git a/sca-java-1.x/trunk/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationDaemonBootstrap.java b/sca-java-1.x/trunk/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationDaemonBootstrap.java index 8de2a3a3f9..b82b27d02d 100644 --- a/sca-java-1.x/trunk/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationDaemonBootstrap.java +++ b/sca-java-1.x/trunk/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationDaemonBootstrap.java @@ -44,16 +44,12 @@ public class NodeImplementationDaemonBootstrap { public void start() { threadContextClassLoader = Thread.currentThread().getContextClassLoader(); - boolean started = false; try { Thread.currentThread().setContextClassLoader(runtimeClassLoader); SCANodeFactory factory = SCANodeFactory.newInstance(); daemon = factory.createSCANodeFromClassLoader("NodeDaemon.composite", threadContextClassLoader); - started = true; } finally { - if (!started) { - Thread.currentThread().setContextClassLoader(threadContextClassLoader); - } + Thread.currentThread().setContextClassLoader(threadContextClassLoader); } } diff --git a/sca-java-1.x/trunk/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationLauncherBootstrap.java b/sca-java-1.x/trunk/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationLauncherBootstrap.java index 0264574fb9..f92e1a7406 100644 --- a/sca-java-1.x/trunk/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationLauncherBootstrap.java +++ b/sca-java-1.x/trunk/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationLauncherBootstrap.java @@ -50,15 +50,11 @@ public class NodeImplementationLauncherBootstrap { public void start() { threadContextClassLoader = Thread.currentThread().getContextClassLoader(); - boolean started = false; try { Thread.currentThread().setContextClassLoader(runtimeClassLoader); delegate.start(); - started = true; } finally { - if (!started) { - Thread.currentThread().setContextClassLoader(threadContextClassLoader); - } + Thread.currentThread().setContextClassLoader(threadContextClassLoader); } } -- cgit v1.2.3