diff --git a/client-runtime/pom.xml b/client-runtime/pom.xml index 5c5aaf4f88..0bc18a2ab8 100644 --- a/client-runtime/pom.xml +++ b/client-runtime/pom.xml @@ -56,6 +56,23 @@ + + org.apache.maven.plugins + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + org.terracotta + provided + + + + diff --git a/client-runtime/src/main/java/com/tc/cmdline/Probe.java b/client-runtime/src/main/java/com/tc/cmdline/Probe.java new file mode 100644 index 0000000000..9139d0d55e --- /dev/null +++ b/client-runtime/src/main/java/com/tc/cmdline/Probe.java @@ -0,0 +1,32 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template + */ +package com.tc.cmdline; + +import java.net.InetSocketAddress; +import java.util.Properties; +import org.terracotta.connection.ConnectionException; +import org.terracotta.connection.DiagnosticsFactory; + +/** + * + * @author mscott2 + */ +public class Probe { + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + String[] hp = args[0].split("[:]"); + InetSocketAddress inet = InetSocketAddress.createUnresolved(hp[0], Integer.parseInt(hp[1])); + try (com.terracotta.diagnostic.Diagnostics d = (com.terracotta.diagnostic.Diagnostics)DiagnosticsFactory.connect(inet, new Properties())) { + System.out.println(d.getThreadDump()); + System.out.println(d.getClusterState()); + } catch (ConnectionException e) { + e.printStackTrace(); + } + } + +} diff --git a/client-runtime/src/main/resources/example.sh b/client-runtime/src/main/resources/example.sh new file mode 100644 index 0000000000..71d36b8e64 --- /dev/null +++ b/client-runtime/src/main/resources/example.sh @@ -0,0 +1,2 @@ +#!/bin/bash +java -cp target/client-runtime-5.8.5.jar:target/dependency/* com.tc.cmdline.Probe $1