/** * Returns the client used to connect to the server. * * @return the client * * @throws IllegalStateException if this has been {@linkplain #close() closed} */ public ModelControllerClient getControllerClient() { checkState(); return client; }
/** * Returns the client used to connect to the server. * * @return the client * * @throws IllegalStateException if this has been {@linkplain #close() closed} */ public ModelControllerClient getControllerClient() { checkState(); return client; }
private ModelNode executeForResult(final ModelNode operation) throws Exception { checkState(); final ModelNode result = client.execute(operation); checkSuccessful(result, operation); return result.get(RESULT); }
private ModelNode executeForResult(final ModelNode operation) throws Exception { checkState(); final ModelNode result = client.execute(operation); checkSuccessful(result, operation); return result.get(RESULT); }
/** * Checks whether or not the server is running. * <p> * Note that if this client has been {@linkplain #close() closed} the state of the server cannot be checked. * </p> * * @return {@code true} if the server is running, otherwise {@code false} * * @throws IllegalStateException if this has been {@linkplain #close() closed} */ public boolean isServerInRunningState() { checkState(); try { ModelNode op = new ModelNode(); op.get(OP).set(READ_ATTRIBUTE_OPERATION); op.get(OP_ADDR).setEmptyList(); op.get(NAME).set("server-state"); ModelNode rsp = client.execute(op); return SUCCESS.equals(rsp.get(OUTCOME).asString()) && !CONTROLLER_PROCESS_STATE_STARTING.equals(rsp.get(RESULT).asString()) && !CONTROLLER_PROCESS_STATE_STOPPING.equals(rsp.get(RESULT).asString()); } catch (RuntimeException rte) { throw rte; } catch (IOException ex) { return false; } }
/** * Checks whether or not the server is running. * <p> * Note that if this client has been {@linkplain #close() closed} the state of the server cannot be checked. * </p> * * @return {@code true} if the server is running, otherwise {@code false} * * @throws IllegalStateException if this has been {@linkplain #close() closed} */ public boolean isServerInRunningState() { checkState(); try { ModelNode op = new ModelNode(); op.get(OP).set(READ_ATTRIBUTE_OPERATION); op.get(OP_ADDR).setEmptyList(); op.get(NAME).set("server-state"); ModelNode rsp = client.execute(op); return SUCCESS.equals(rsp.get(OUTCOME).asString()) && !CONTROLLER_PROCESS_STATE_STARTING.equals(rsp.get(RESULT).asString()) && !CONTROLLER_PROCESS_STATE_STOPPING.equals(rsp.get(RESULT).asString()); } catch (RuntimeException rte) { throw rte; } catch (IOException ex) { return false; } }