org.axonframework.eventhandling.async
Class EventProcessor.ProcessingResult

java.lang.Object
  extended by org.axonframework.eventhandling.async.RetryPolicy
      extended by org.axonframework.eventhandling.async.EventProcessor.ProcessingResult
Enclosing class:
EventProcessor

protected static class EventProcessor.ProcessingResult
extends RetryPolicy

Class indicating the result of Event Processing and the policy for resuming or retrying in case of errors.


Field Summary
static EventProcessor.ProcessingResult REGULAR
          Instance indicating processing was successful and should proceed normally.
 
Constructor Summary
EventProcessor.ProcessingResult(RetryPolicy retryPolicy, Throwable error)
          Creates an instance requiring the given retryPolicy and reporting the given (optional) error to indicate a failure.
 
Method Summary
 Throwable getError()
          Returns the exception that caused the processing to fail
 boolean isFailure()
          Indicates whether processing failed
 boolean requiresRescheduleEvent()
          Indicates whether the scheduler should reschedule the failed event.
 boolean requiresRollback()
          Indicates whether the scheduler should rollback the Unit of Work wrapping the event handling.
 long waitTime()
          Returns the time the scheduler should wait before continuing processing.
 
Methods inherited from class org.axonframework.eventhandling.async.RetryPolicy
proceed, retryAfter, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REGULAR

public static final EventProcessor.ProcessingResult REGULAR
Instance indicating processing was successful and should proceed normally.

Constructor Detail

EventProcessor.ProcessingResult

public EventProcessor.ProcessingResult(RetryPolicy retryPolicy,
                                       Throwable error)
Creates an instance requiring the given retryPolicy and reporting the given (optional) error to indicate a failure.

Parameters:
retryPolicy - The policy indication how to continue processing
error - An (optional) error to indicate a failure occurred
Method Detail

isFailure

public boolean isFailure()
Indicates whether processing failed

Returns:
true if an error was reported, otherwise false

getError

public Throwable getError()
Returns the exception that caused the processing to fail

Returns:
the exception that caused the processing to fail, or null if no failure was reported

waitTime

public long waitTime()
Description copied from class: RetryPolicy
Returns the time the scheduler should wait before continuing processing. This value is ignored if RetryPolicy.requiresRescheduleEvent() returns false.

Specified by:
waitTime in class RetryPolicy
Returns:
the amount of time, in milliseconds, the scheduler should wait before continuing processing.

requiresRescheduleEvent

public boolean requiresRescheduleEvent()
Description copied from class: RetryPolicy
Indicates whether the scheduler should reschedule the failed event.

Specified by:
requiresRescheduleEvent in class RetryPolicy
Returns:
true if the scheduler should reschedule the failed event, otherwise false

requiresRollback

public boolean requiresRollback()
Description copied from class: RetryPolicy
Indicates whether the scheduler should rollback the Unit of Work wrapping the event handling.

Specified by:
requiresRollback in class RetryPolicy
Returns:
true to indicate the scheduler should perform a rollback or false to request a commit.


Copyright © 2010-2016. All Rights Reserved.