boolean sendToSelf = getExecutionTarget().equals(getAddress());
CancelCommand ccc = factory.buildCancelCommandCommand(distCommand.getUUID());
if (sendToSelf) {
ccc.init(cancellationService);
try {
ccc.perform(null);
} catch (Throwable e) {
log.couldNotExecuteCancellationLocally(e.getLocalizedMessage());
}
} else {
rpc.invokeRemotely(Collections.singletonList(getExecutionTarget()), ccc, true);