Package alpine.event.framework
Class AbstractChainableEvent
java.lang.Object
alpine.event.framework.AbstractChainableEvent
- All Implemented Interfaces:
ChainableEvent,Event
- Direct Known Subclasses:
SingletonCapableEvent
Provides a default abstract implementation of an Event which supports
an unbounded chain of callbacks that can be routed between different
IEventService implementations.- Since:
- 1.2.0
- Author:
- Steve Springett
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the unique identifier for the chain this event is a part of.Returns the unique identifier for this event.Returns the optional callback event that should be processed if this event is not successful.Fluent method that sets the onFailure Event and returns this object.onFailure(Event onFailureEvent, Class<? extends IEventService> onFailureEventService) Fluent method that sets the onFailure Event and returns this object.Returns the optional callback event that should be processed if this event is successful.Fluent method that sets the onSuccess Event and returns this object.onSuccess(Event onSuccessEvent, Class<? extends IEventService> onSuccessEventService) Fluent method that sets the onSuccess Event and returns this object.voidsetChainIdentifier(UUID chainIdentifier) Sets the unique identifier for the chain this event is a part of.
-
Constructor Details
-
AbstractChainableEvent
public AbstractChainableEvent()
-
-
Method Details
-
getEventIdentifier
Returns the unique identifier for this event.- Specified by:
getEventIdentifierin interfaceChainableEvent- Returns:
- the unique identifier for this event
- Since:
- 1.4.0
-
getChainIdentifier
Returns the unique identifier for the chain this event is a part of.- Specified by:
getChainIdentifierin interfaceChainableEvent- Returns:
- the unique identifier for the chain this event is a part of
- Since:
- 1.4.0
-
setChainIdentifier
Sets the unique identifier for the chain this event is a part of.- Specified by:
setChainIdentifierin interfaceChainableEvent- Parameters:
chainIdentifier- the UUID of the chain- Since:
- 1.4.0
-
onSuccess
Returns the optional callback event that should be processed if this event is successful.- Specified by:
onSuccessin interfaceChainableEvent- Returns:
- an Event
- Since:
- 1.2.0
-
onFailure
Returns the optional callback event that should be processed if this event is not successful.- Specified by:
onFailurein interfaceChainableEvent- Returns:
- an Event
- Since:
- 1.2.0
-
onSuccess
Fluent method that sets the onSuccess Event and returns this object.- Specified by:
onSuccessin interfaceChainableEvent- Parameters:
onSuccessEvent- the event to publish if this event succeeds- Returns:
- the current object
- Since:
- 1.2.0
-
onSuccess
public ChainableEvent onSuccess(Event onSuccessEvent, Class<? extends IEventService> onSuccessEventService) Fluent method that sets the onSuccess Event and returns this object.- Specified by:
onSuccessin interfaceChainableEvent- Parameters:
onSuccessEvent- the event to publish if this event succeedsonSuccessEventService- the specific IEventService implementation to use- Returns:
- the current object
- Since:
- 1.2.0
-
onFailure
Fluent method that sets the onFailure Event and returns this object.- Specified by:
onFailurein interfaceChainableEvent- Parameters:
onFailureEvent- the event to publish if this event fails- Returns:
- the current object
- Since:
- 1.2.0
-
onFailure
public ChainableEvent onFailure(Event onFailureEvent, Class<? extends IEventService> onFailureEventService) Fluent method that sets the onFailure Event and returns this object.- Specified by:
onFailurein interfaceChainableEvent- Parameters:
onFailureEvent- the event to publish if this event failsonFailureEventService- the specific IEventService implementation to use- Returns:
- the current object
- Since:
- 1.2.0
-