Search in sources :

Example 1 with ConsoleCommandHandler

use of com.hazelcast.internal.management.ConsoleCommandHandler in project hazelcast by hazelcast.

the class ConsoleCommandRequest method writeResponse.

@Override
public void writeResponse(ManagementCenterService mcs, JsonObject root) throws Exception {
    ConsoleCommandHandler handler = mcs.getCommandHandler();
    JsonObject result = new JsonObject();
    try {
        final String output = handler.handleCommand(command);
        result.add("output", output);
    } catch (Throwable e) {
        result.add("output", "Error: " + e.getClass().getSimpleName() + "[" + e.getMessage() + "]");
    }
    root.add("result", result);
}
Also used : JsonObject(com.eclipsesource.json.JsonObject) JsonUtil.getString(com.hazelcast.util.JsonUtil.getString) ConsoleCommandHandler(com.hazelcast.internal.management.ConsoleCommandHandler)

Aggregations

JsonObject (com.eclipsesource.json.JsonObject)1 ConsoleCommandHandler (com.hazelcast.internal.management.ConsoleCommandHandler)1 JsonUtil.getString (com.hazelcast.util.JsonUtil.getString)1