private void commit(AppendEventTransaction appendEventTransaction) { try { appendEventTransaction.commit(); } catch (ExecutionException e) { throw new EventStoreException(e.getMessage(), e.getCause()); } catch (TimeoutException e) { throw new org.axonframework.messaging.ExecutionException("Timeout while executing request", e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new EventStoreException(e.getMessage(), e); } }
private void executeScheduledDeadline(ScopeAwareProvider scopeAwareComponents, DeadlineMessage deadlineMessage, ScopeDescriptor deadlineScope) { scopeAwareComponents.provideScopeAwareStream(deadlineScope) .filter(scopeAwareComponent -> scopeAwareComponent.canResolve(deadlineScope)) .forEach(scopeAwareComponent -> { try { scopeAwareComponent.send(deadlineMessage, deadlineScope); } catch (Exception e) { String exceptionMessage = String.format( "Failed to send a DeadlineMessage for scope [%s]", deadlineScope.scopeDescription() ); throw new ExecutionException(exceptionMessage, e); } }); }
@SuppressWarnings("Duplicates") private void executeScheduledDeadline(DeadlineMessage deadlineMessage, ScopeDescriptor deadlineScope) { scopeAwareProvider.provideScopeAwareStream(deadlineScope) .filter(scopeAwareComponent -> scopeAwareComponent.canResolve(deadlineScope)) .forEach(scopeAwareComponent -> { try { scopeAwareComponent.send(deadlineMessage, deadlineScope); } catch (Exception e) { String exceptionMessage = format( "Failed to send a DeadlineMessage for scope [%s]", deadlineScope.scopeDescription() ); throw new ExecutionException(exceptionMessage, e); } }); } }
private void commit(AppendEventTransaction appendEventTransaction) { try { appendEventTransaction.commit(); } catch (ExecutionException e) { throw new EventStoreException(e.getMessage(), e.getCause()); } catch (TimeoutException e) { throw new org.axonframework.messaging.ExecutionException("Timeout while executing request", e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new EventStoreException(e.getMessage(), e); } }
/** * Returns the execution result. If the execution was completed successfully but yielded no result this method * returns {@code null}. If the execution gave rise to an exception, invoking this method will throw an * exception. Unchecked exceptions will be thrown directly. Checked exceptions are wrapped by a * {@link org.axonframework.messaging.ExecutionException}. * * @return The result of the execution if the operation was executed without raising an exception. */ public Object getResult() { if (isExceptionResult()) { if (result instanceof RuntimeException) { throw (RuntimeException) result; } if (result instanceof Error) { throw (Error) result; } throw new ExecutionException("Execution of the task gave rise to an exception", (Throwable) result); } return result; }
private void executeScheduledDeadline(ScopeAwareProvider scopeAwareComponents, DeadlineMessage deadlineMessage, ScopeDescriptor deadlineScope) { scopeAwareComponents.provideScopeAwareStream(deadlineScope) .filter(scopeAwareComponent -> scopeAwareComponent.canResolve(deadlineScope)) .forEach(scopeAwareComponent -> { try { scopeAwareComponent.send(deadlineMessage, deadlineScope); } catch (Exception e) { String exceptionMessage = String.format( "Failed to send a DeadlineMessage for scope [%s]", deadlineScope.scopeDescription() ); throw new ExecutionException(exceptionMessage, e); } }); }
private void executeScheduledDeadline(DeadlineMessage deadlineMessage, ScopeDescriptor deadlineScope) { scopeAwareProvider.provideScopeAwareStream(deadlineScope) .filter(scopeAwareComponent -> scopeAwareComponent.canResolve(deadlineScope)) .forEach(scopeAwareComponent -> { try { scopeAwareComponent.send(deadlineMessage, deadlineScope); } catch (Exception e) { String exceptionMessage = String.format( "Failed to send a DeadlineMessage for scope [%s]", deadlineScope.scopeDescription() ); throw new ExecutionException(exceptionMessage, e); } }); } }
private void executeScheduledDeadline(ScopeAwareProvider scopeAwareComponents, DeadlineMessage deadlineMessage, ScopeDescriptor deadlineScope) { scopeAwareComponents.provideScopeAwareStream(deadlineScope) .filter(scopeAwareComponent -> scopeAwareComponent.canResolve(deadlineScope)) .forEach(scopeAwareComponent -> { try { scopeAwareComponent.send(deadlineMessage, deadlineScope); } catch (Exception e) { String exceptionMessage = String.format( "Failed to send a DeadlineMessage for scope [%s]", deadlineScope.scopeDescription() ); throw new ExecutionException(exceptionMessage, e); } }); }
@SuppressWarnings("Duplicates") private void executeScheduledDeadline(DeadlineMessage deadlineMessage, ScopeDescriptor deadlineScope) { scopeAwareProvider.provideScopeAwareStream(deadlineScope) .filter(scopeAwareComponent -> scopeAwareComponent.canResolve(deadlineScope)) .forEach(scopeAwareComponent -> { try { scopeAwareComponent.send(deadlineMessage, deadlineScope); } catch (Exception e) { String exceptionMessage = format( "Failed to send a DeadlineMessage for scope [%s]", deadlineScope.scopeDescription() ); throw new ExecutionException(exceptionMessage, e); } }); } }