Package org.jgrapes.core.events
Class Error
- All Implemented Interfaces:
- Future<Void>,- Associator,- Eligible
- Direct Known Subclasses:
- HandlingError,- HostUnresolved,- IOError,- JsonParsingError
This event signals that an error occurred while processing an event.
- 
Nested Class SummaryNested classes/interfaces inherited from interface java.util.concurrent.FutureFuture.State
- 
Field SummaryFields inherited from class org.jgrapes.core.internal.EventBasecompleted, completionEvents, invokedFor
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new event.Creates a new event caused by the given throwable.Creates a new event caused by the given throwable.Creates a new event as a copy of an existing event.
- 
Method SummaryMethods inherited from class org.jgrapes.core.EventaddCompletionEvent, associated, cancel, channels, channels, completionEvents, currentResults, defaultCriterion, forChannels, get, get, handled, handlingError, isCancelled, isDone, isEligibleFor, isStopped, processedBy, results, results, resumeHandling, setAssociated, setChannels, setRequiresResult, setResult, stop, suspendHandling, suspendHandling, tieToMethods inherited from class org.jgrapes.core.internal.EventBasedisableTracking, enqueued, firstResultAssigned, isTracked, onCompletionMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jgrapes.core.Associatorassociated, associated, associated, associatedGetMethods inherited from interface java.util.concurrent.FutureexceptionNow, resultNow, state
- 
Constructor Details- 
ErrorCreates a new event as a copy of an existing event.Useful for forwarding an event. Constructors “ <T extend Error> T(T event)” must be implemented by all derived classes.- Parameters:
- event- the event to copy
 
- 
ErrorCreates a new event.- Parameters:
- event- the event being processed when the problem occurred
- message- the message
 
- 
ErrorCreates a new event caused by the given throwable.- Parameters:
- event- the event being processed when the problem occurred
- message- the message
- throwable- the throwable
 
- 
ErrorCreates a new event caused by the given throwable.The message is initialized from the throwable. - Parameters:
- event- the event being processed when the problem occurred
- throwable- the throwable
 
 
- 
- 
Method Details- 
duplicateDuplicate the event.Returns a new event with the same class and the same properties of the given event. Relies on the proper implementation of constructors “ <T extend Error> T(T event)” for derived classes.Creating a duplicate id useful for forwarding a derived Errorwhile handling a base class.- Type Parameters:
- T- the generic type
- Parameters:
- event- the event
- Returns:
- the t
 
- 
eventReturns the event that was handled when the problem occurred.- Returns:
- the event
 
- 
messageReturns the message passed to the constructor.- Returns:
- the message
 
- 
throwableReturns the throwable that caused the problem.- Returns:
- the throwable or null if the problem wasn’t caused by a throwable.
 
- 
toString
 
-