- java.lang.Object
- 
- aeonics.template.Item<Action.Type>
- 
- aeonics.entity.Action
 
 
- 
- Direct Known Subclasses:
- Router
 
 public abstract class Action extends Item<Action.Type> This entity represents an Action taken against data. It is an intermediate step of a data flow.Every time some data is available the Action.Type.accept(Message, String, Set)method will be called.Be careful that multiple calls to the Action.Type.accept(Message, String, Set)method may happen in parallel. If your implementation is not thread safe, you should add proper thread safety (example with asynchronizedblock statement).There are two recommended ways to create your own action inline (without creating a full class). The first method allows to provide the data processing function and registers automatically the template in the factory and the instance in the registry: Action.Type action = new Action() { } // <-- note the '{ }' to create a new anonymous class .template() // <-- create the template and register it in the factory // add all your template documentation .summary("Does something") .create() // <-- create an instance of the entity and register it in the registry // set the processing function .process((message, input, outputs) -> null); // <-- the process logicIf you need more control over the behavior such as private member variables or multiple methods, then you need to declare a custom entity end register it before calling the template method: public static class MyEntity extends Action.Type { private int response = 42; private Map<String, Message> respond() { return new HashMap<>("response", response); } public Map<String, Message> accept(Message message, String input, Set<String> outputs) { return respond(); } } Action.Type action = new Action() { } // <-- note the '{ }' to create a new anonymous class // register the custom entity before calling the template .target(MyEntity.class) .creator(MyEntity::new) .template() // <-- create the template and register it in the factory // add all your template documentation .summary("Do something") .create(); // <-- create an instance of the entity and register it in the registry
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classAction.TemplateSuperclass template for actionsstatic classAction.TypeSuperclass for all action entities.
 - 
Constructor SummaryConstructors Constructor Description Action()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Class<? extends Action>category()Returns the target entity category.protected java.util.function.Supplier<? extends Action.Type>defaultCreator()Returns the default target entity creator.protected java.lang.Class<? extends Action.Type>defaultTarget()Returns the default target entity type.Action.Templatetemplate()Returns the template to build the target entity.
 
- 
- 
- 
Method Detail- 
defaultTargetprotected java.lang.Class<? extends Action.Type> defaultTarget() Description copied from class:ItemReturns the default target entity type. This method should be implemented by subclasses to specify the target entity type.- Specified by:
- defaultTargetin class- Item<Action.Type>
- Returns:
- the default target entity type
 
 - 
defaultCreatorprotected java.util.function.Supplier<? extends Action.Type> defaultCreator() Description copied from class:ItemReturns the default target entity creator. This method should be implemented by subclasses to specify the entity creator.- Specified by:
- defaultCreatorin class- Item<Action.Type>
- Returns:
- the default target entity creator
 
 - 
categoryprotected java.lang.Class<? extends Action> category() Description copied from class:ItemReturns the target entity category. This method should be implemented by subclasses to specify the entity category.- Specified by:
- categoryin class- Item<Action.Type>
- Returns:
- the target entity category
 
 - 
templatepublic Action.Template template() Description copied from class:ItemReturns the template to build the target entity.This method should ultimately be used to provide the final entity template. Although, it may also provide a partial template that subclassed may complement. - Overrides:
- templatein class- Item<Action.Type>
- Returns:
- the matching entity template
 
 
- 
 
-