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 Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Field Summary
Fields inherited from class org.jgrapes.core.internal.EventBase
completed, completionEvents, invokedFor
-
Constructor Summary
ConstructorDescriptionCreates 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 Summary
Methods inherited from class org.jgrapes.core.Event
addCompletionEvent, 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, tieTo
Methods inherited from class org.jgrapes.core.internal.EventBase
disableTracking, enqueued, firstResultAssigned, isTracked, onCompletion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jgrapes.core.Associator
associated, associated, associated, associatedGet
Methods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Constructor Details
-
Error
Creates 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
-
Error
Creates a new event.- Parameters:
event
- the event being processed when the problem occurredmessage
- the message
-
Error
Creates a new event caused by the given throwable.- Parameters:
event
- the event being processed when the problem occurredmessage
- the messagethrowable
- the throwable
-
Error
Creates a new event caused by the given throwable.The message is initialized from the throwable.
- Parameters:
event
- the event being processed when the problem occurredthrowable
- the throwable
-
-
Method Details
-
duplicate
Duplicate 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
Error
while handling a base class.- Type Parameters:
T
- the generic type- Parameters:
event
- the event- Returns:
- the t
-
event
Returns the event that was handled when the problem occurred.- Returns:
- the event
-
message
Returns the message passed to the constructor.- Returns:
- the message
-
throwable
Returns the throwable that caused the problem.- Returns:
- the throwable or null if the problem wasn’t caused by a throwable.
-
toString
-