org.axonframework.commandhandling.disruptor
Class AggregateStateCorruptedException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.axonframework.common.AxonException
                  extended by org.axonframework.common.AxonTransientException
                      extended by org.axonframework.commandhandling.disruptor.AggregateStateCorruptedException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AggregateBlacklistedException

public class AggregateStateCorruptedException
extends AxonTransientException

Exception indicating that the changes in an aggregate (generated events) are ignored by the DisruptorCommandBus, because it cannot guarantee that these changes have been applied to an aggregate instance with the correct state. The DisruptorCommandBus will automatically recover by clearing cached information of blacklisted aggregates. Because of the asynchronous nature of the DisruptorCommandBus, several commands may fail due to the same corrupt aggregate.

When a corrupt aggregate has been detected, a AggregateBlacklistedException is thrown. Each subsequent time state changes are applied to a blacklisted aggregate, an AggregateStateCorruptedException is thrown.

It is generally safe to retry any commands that resulted in this exception, unless the cause is clearly non-transient.

Since:
2.0
Author:
Allard Buijze
See Also:
Serialized Form

Constructor Summary
AggregateStateCorruptedException(Object aggregateIdentifier, String message)
          Initializes the exception with given aggregateIdentifier and given explanatory message.
AggregateStateCorruptedException(Object aggregateIdentifier, String message, Throwable cause)
          Initializes the exception with given aggregateIdentifier, given explanatory message and cause.
 
Method Summary
 Object getAggregateIdentifier()
          Returns the identifier of the blacklisted aggregate.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AggregateStateCorruptedException

public AggregateStateCorruptedException(Object aggregateIdentifier,
                                        String message)
Initializes the exception with given aggregateIdentifier and given explanatory message.

Parameters:
aggregateIdentifier - The identifier of the blacklisted aggregate
message - The message explaining why the blacklisting occurred

AggregateStateCorruptedException

public AggregateStateCorruptedException(Object aggregateIdentifier,
                                        String message,
                                        Throwable cause)
Initializes the exception with given aggregateIdentifier, given explanatory message and cause.

Parameters:
aggregateIdentifier - The identifier of the blacklisted aggregate
message - The message explaining why the blacklisting occurred
cause - The cause of the blacklist
Method Detail

getAggregateIdentifier

public Object getAggregateIdentifier()
Returns the identifier of the blacklisted aggregate.

Returns:
the identifier of the blacklisted aggregate


Copyright © 2010-2016. All Rights Reserved.