org.multiverse.api.exceptions
Class ControlFlowError

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Error
          extended by org.multiverse.api.exceptions.ControlFlowError
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ReadConflict, Retry, SpeculativeConfigurationFailure, WriteConflict

public abstract class ControlFlowError
extends Error

A Error that is used to regulate control flow inside multiverse, to be more specific jump from code to the handler the transaction management logic (instrumented or SpeculativeConfigurationFailure) so it doesn't indicate a bad thing.

Normally it would be a very bad thing to regulate control flow using an exception/error, but to make seamless integration in the Java language possible, there is no better alternative. So you should not catch these exceptions unless you really know what you are doing.

It is an Error instead of a RuntimeException, to prevent users trying to catch the error inside a try/catch(RuntimeException) block and consuming important events like a ReadConflict or a WriteConflict. In most cases these events can be solved by retrying the transaction.

Author:
Peter Veentjer
See Also:
Serialized Form

Constructor Summary
ControlFlowError()
           
ControlFlowError(String message)
           
ControlFlowError(String message, Throwable cause)
           
ControlFlowError(Throwable cause)
           
 
Method Summary
abstract  String getDescription()
           
 
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

ControlFlowError

public ControlFlowError()

ControlFlowError

public ControlFlowError(Throwable cause)

ControlFlowError

public ControlFlowError(String message)

ControlFlowError

public ControlFlowError(String message,
                        Throwable cause)
Method Detail

getDescription

public abstract String getDescription()


Copyright © 2008-2010 Multiverse. All Rights Reserved.