http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ce625dcd/modules/core/src/main/java/org/gridgain/grid/kernal/visor/util/VisorTaskUtils.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/visor/util/VisorTaskUtils.java b/modules/core/src/main/java/org/gridgain/grid/kernal/visor/util/VisorTaskUtils.java index 345b774..c5ae2b4 100644 --- a/modules/core/src/main/java/org/gridgain/grid/kernal/visor/util/VisorTaskUtils.java +++ b/modules/core/src/main/java/org/gridgain/grid/kernal/visor/util/VisorTaskUtils.java @@ -778,4 +778,46 @@ public class VisorTaskUtils { return false; } } + + /** + * Run command in separated console. + * + * @param args A string array containing the program and its arguments. + * @return Started process. + */ + public static Process openInConsole(String... args) throws IOException { + return openInConsole(null, args); + } + + /** + * Run command in separated console. + * + * @param workFolder Work folder for command. + * @param args A string array containing the program and its arguments. + * @return Started process. + * @throws IOException If failed to start process. + */ + public static Process openInConsole(@Nullable File workFolder, String... args) + throws IOException { + String[] commands = args; + + String cmd = F.concat(Arrays.asList(args), " "); + + if (U.isWindows()) + commands = F.asArray("cmd", "/c", String.format("start %s", cmd)); + + if (U.isMacOs()) + commands = F.asArray("osascript", "-e", + String.format("tell application \"Terminal\" to do script \"%s\"", cmd)); + + if (U.isUnix()) + commands = F.asArray("xterm", "-sl", "1024", "-geometry", "200x50", "-e", cmd); + + ProcessBuilder pb = new ProcessBuilder(commands); + + if (workFolder != null) + pb.directory(workFolder); + + return pb.start(); + } }
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ce625dcd/modules/core/src/main/resources/gridgain.properties ---------------------------------------------------------------------- diff --git a/modules/core/src/main/resources/gridgain.properties b/modules/core/src/main/resources/gridgain.properties index 580817e..d8362cf 100644 --- a/modules/core/src/main/resources/gridgain.properties +++ b/modules/core/src/main/resources/gridgain.properties @@ -1,4 +1,4 @@ -gridgain.version=6.5.6 +gridgain.version=6.5.7 gridgain.build=0 gridgain.revision=DEV gridgain.rel.date=01011970 http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ce625dcd/modules/visor-console/src/main/scala/org/gridgain/visor/commands/vvm/VisorVvmCommand.scala ---------------------------------------------------------------------- diff --git a/modules/visor-console/src/main/scala/org/gridgain/visor/commands/vvm/VisorVvmCommand.scala b/modules/visor-console/src/main/scala/org/gridgain/visor/commands/vvm/VisorVvmCommand.scala index 6871da3..10ac180 100644 --- a/modules/visor-console/src/main/scala/org/gridgain/visor/commands/vvm/VisorVvmCommand.scala +++ b/modules/visor-console/src/main/scala/org/gridgain/visor/commands/vvm/VisorVvmCommand.scala @@ -187,6 +187,9 @@ class VisorVvmCommand { val neighbors = grid.forHost(grid.localNode).nodes() + if (U.isWindows) + vvmCmd = "cmd /c \"%s\"".format(vvmCmd) + for (node <- nodes if !neighbors.contains(node)) { val port = node.attribute[java.lang.Integer](ATTR_JMX_PORT) @@ -205,8 +208,7 @@ class VisorVvmCommand { case Some(addr) => // Sequential calls to VisualVM will not start separate processes // but will add new JMX connection to it. -// Runtime.getRuntime.exec(vvmCommandArray(vvmCmd + " --openjmx " + addr + ":" + port)) TODO GG-9577 - Runtime.getRuntime.exec(vvmCmd + " --openjmx " + addr + ":" + port) + TU.openInConsole(vvmCmd + " --openjmx " + addr + ":" + port) started = true case None => @@ -216,8 +218,7 @@ class VisorVvmCommand { } if (!started) -// Runtime.getRuntime.exec(vvmCommandArray(vvmCmd)) TODO GG-9577 - Runtime.getRuntime.exec(vvmCmd) + TU.openInConsole(vvmCmd) } }