@Override public boolean execute(ManagedServer server) throws Exception { final ModelNode operation = new ModelNode(); operation.get(OP).set(RELOAD); operation.get(OP_ADDR).setEmptyList(); if(suspend) { operation.get(START_MODE).set(SUSPEND); } // See WFCORE-1791, Operation-id is sent back again to the HC in // HostControllerConnection.ServerRegisterRequest.sendRequest method. // With this operation-id ServerRegistrationStepHandler is able to acquire // the lock and register the server in the domain. operation.get("operation-id").set(permit); try { final TransactionalProtocolClient.PreparedOperation<?> prepared = TransactionalProtocolHandlers.executeBlocking(operation, protocolClient); if (prepared.isFailed()) { return false; } prepared.commit(); // Just commit and discard the result } catch (IOException ignore) { // } return true; } }
@Override public boolean execute(ManagedServer server) throws Exception { final ModelNode operation = new ModelNode(); operation.get(OP).set(RELOAD); operation.get(OP_ADDR).setEmptyList(); if(suspend) { operation.get(START_MODE).set(SUSPEND); } // See WFCORE-1791, Operation-id is sent back again to the HC in // HostControllerConnection.ServerRegisterRequest.sendRequest method. // With this operation-id ServerRegistrationStepHandler is able to acquire // the lock and register the server in the domain. operation.get("operation-id").set(permit); try { final TransactionalProtocolClient.PreparedOperation<?> prepared = TransactionalProtocolHandlers.executeBlocking(operation, protocolClient); if (prepared.isFailed()) { return false; } prepared.commit(); // Just commit and discard the result } catch (IOException ignore) { // } return true; } }
continue; prepared.commit(); prepared.getFinalResult().get(timeout, TimeUnit.MILLISECONDS); } catch (InterruptedException e) {
prepared.commit(); } else { prepared.rollback();
continue; prepared.commit(); prepared.getFinalResult().get(timeout, TimeUnit.MILLISECONDS); } catch (InterruptedException e) {
continue; prepared.commit(); prepared.getFinalResult().get(timeout, TimeUnit.MILLISECONDS); } catch (InterruptedException e) {
continue; prepared.commit(); prepared.getFinalResult().get(timeout, TimeUnit.MILLISECONDS); } catch (InterruptedException e) {
prepared.commit(); } else { prepared.rollback();
prepared.commit(); } else { prepared.rollback();
prepared.commit(); prepared.getFinalResult().get();
prepared.commit(); prepared.getFinalResult().get();
/** * Finalize the transaction. This will return {@code false} in case the local operation failed, * but the overall state of the operation is commit=true. * * @param commit {@code true} to commit, {@code false} to rollback * @return whether the local proxy operation result is in sync with the overall operation */ public boolean finalizeTransaction(boolean commit) { final boolean failed = preparedOperation.isFailed(); if(commit && failed) { return false; } if(commit) { preparedOperation.commit(); } else { if(!failed) { preparedOperation.rollback(); } } return true; }
/** * Finalize the transaction. This will return {@code false} in case the local operation failed, * but the overall state of the operation is commit=true. * * @param commit {@code true} to commit, {@code false} to rollback * @return whether the local proxy operation result is in sync with the overall operation */ public boolean finalizeTransaction(boolean commit) { final boolean failed = preparedOperation.isFailed(); if(commit && failed) { return false; } if(commit) { preparedOperation.commit(); } else { if(!failed) { preparedOperation.rollback(); } } return true; }
/** * Finalize the transaction. This will return {@code false} in case the local operation failed, * but the overall state of the operation is commit=true. * * @param commit {@code true} to commit, {@code false} to rollback * @return whether the local proxy operation result is in sync with the overall operation */ public boolean finalizeTransaction(boolean commit) { final boolean failed = preparedOperation.isFailed(); if(commit && failed) { return false; } if(commit) { preparedOperation.commit(); } else { if(!failed) { preparedOperation.rollback(); } } return true; }