@API(status=INTERNAL)
public abstract class AbstractActivity<E,C extends ActivityContext<E>>
extends java.lang.Object
Constructor and Description |
---|
AbstractActivity() |
Modifier and Type | Method and Description |
---|---|
protected void |
beforeMatcher(C context)
This callback can be used to prepare
ActivityContext before actually processing the
ActivityMatcher.matches(ActivityContext) method. |
protected abstract void |
bindToRealTimeEventsSource(java.util.function.Consumer<RealTimeEventListener> realTimeEventsSource)
Bind an Activity to its real-time event.
|
protected C |
createContextInstance(V4Initiator initiator,
E event) |
ActivityInfo |
getInfo()
Retrieve activity details.
|
protected abstract ActivityInfo |
info()
Build activity info.
|
protected abstract ActivityMatcher<C> |
matcher()
Any kind of activity must provide an
ActivityMatcher in order to detect if it can be applied to a certain
user input. |
protected abstract void |
onActivity(C context)
Contain the activity business logic.
|
protected void |
processEvent(V4Initiator initiator,
E event) |
protected abstract ActivityMatcher<C> matcher()
ActivityMatcher
in order to detect if it can be applied to a certain
user input.ActivityMatcher
implementation.protected abstract void onActivity(C context)
ActivityMatcher.matches(ActivityContext)
retured
a true value.context
- The activity context object.protected abstract void bindToRealTimeEventsSource(java.util.function.Consumer<RealTimeEventListener> realTimeEventsSource)
realTimeEventsSource
- The real-time events source, issued from the DatafeedLoop
.protected abstract ActivityInfo info()
public ActivityInfo getInfo()
protected void beforeMatcher(C context)
ActivityContext
before actually processing the
ActivityMatcher.matches(ActivityContext)
method.protected void processEvent(V4Initiator initiator, E event)
protected C createContextInstance(V4Initiator initiator, E event)