[jboss-cvs] JBoss Profiler SVN: r541 - branches/JBossProfiler2/src/main/org/jboss/profiler/agent.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jun 1 17:00:11 EDT 2009


Author: jesper.pedersen
Date: 2009-06-01 17:00:11 -0400 (Mon, 01 Jun 2009)
New Revision: 541

Modified:
   branches/JBossProfiler2/src/main/org/jboss/profiler/agent/Agent.java
Log:
[JBPROFILER-75] Shutdown connector if remote=yes


Modified: branches/JBossProfiler2/src/main/org/jboss/profiler/agent/Agent.java
===================================================================
--- branches/JBossProfiler2/src/main/org/jboss/profiler/agent/Agent.java	2009-05-31 16:03:47 UTC (rev 540)
+++ branches/JBossProfiler2/src/main/org/jboss/profiler/agent/Agent.java	2009-06-01 21:00:11 UTC (rev 541)
@@ -882,19 +882,21 @@
     instrumentation = inst;
     instrumentation.addTransformer(transformer);
 
-    if (save) {
+    if (save || remote) {
       Runtime.getRuntime().addShutdownHook(new Thread() {
         @Override
         public void run() {
           Profiler.stopProfiler();
 
-          for (Snapshot snapshot : Profiler.getSnapshots()) {
-            try {
-              SnapshotHelper.save(snapshot, new File(SnapshotHelper.getName(snapshot) + ".jps"));
-            } catch (Exception e) {
-              System.err.println(e.getMessage());
-              e.printStackTrace(System.err);
-            }
+          if (save) {
+             for (Snapshot snapshot : Profiler.getSnapshots()) {
+                try {
+                   SnapshotHelper.save(snapshot, new File(SnapshotHelper.getName(snapshot) + ".jps"));
+                } catch (Exception e) {
+                   System.err.println(e.getMessage());
+                   e.printStackTrace(System.err);
+                }
+             }
           }
 
           if (connector != null) {




More information about the jboss-cvs-commits mailing list