Package org.apache.unomi.api.actions
Interface ActionDispatcher
-
- All Known Implementing Classes:
GroovyActionDispatcher
public interface ActionDispatcher
This class is the base interface for action dispatcher, which provide a pluggeable way to implement classes that will dispatcher to execute actions. This may include dispatcher for scripting technologies such as Groovy or others. The ActionExecutor class is not related to this, it is only used for Java implementations of Actions, whereas ActionDispatchers may be used for other languages.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Integer
execute(Action action, Event event, String actionName)
This method is responsible of executing the action logic, so it will probably dispatch to an underlying engine such as a scripting engine or any other type.String
getPrefix()
Retrieves the prefix that this dispatcher recognizes and that is used in the actionTypeId.
-
-
-
Method Detail
-
getPrefix
String getPrefix()
Retrieves the prefix that this dispatcher recognizes and that is used in the actionTypeId. For example to dispatch to a GroovyActionDispatcher, the prefix could be : "groovy". Then when you want to refer to a Groovy action type you could do something like this: "groovy:myGroovyAction". Prefixes MUST be globally unique. Not sanity check is done on this so please be careful!- Returns:
- a string containing the unique
-
execute
Integer execute(Action action, Event event, String actionName)
This method is responsible of executing the action logic, so it will probably dispatch to an underlying engine such as a scripting engine or any other type. This makes it possible for example to implement actions in Groovy or even Javascript.- Parameters:
action
- theAction
to executeevent
- theEvent
that triggered the actionactionName
- the name of the action to execute that is after the prefix in the action type- Returns:
- an integer status corresponding to what happened as defined by public constants of
EventService
-
-