public class TypePreprocessor extends PreprocessorAdapter
Preprocessor.Processor<T extends Event>
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.Class<? extends Event>,Preprocessor.Processor<? extends Event>> |
processors
The procesors.
|
logger
Constructor and Description |
---|
TypePreprocessor(java.lang.String name)
Create the object.
|
Modifier and Type | Method and Description |
---|---|
<T extends Event> |
addProcessor(java.lang.Class<T> clazz,
Preprocessor.Processor<T> processor)
Add a new processor.
|
protected Preprocessor.Processor |
findProcessor(Event event)
Find appropriate processor for an event.
|
process
close, getName, start
private final java.util.Map<java.lang.Class<? extends Event>,Preprocessor.Processor<? extends Event>> processors
public TypePreprocessor(java.lang.String name)
name
- the name of the event processorpublic <T extends Event> void addProcessor(java.lang.Class<T> clazz, Preprocessor.Processor<T> processor) throws FsmException
clazz
- the type of eventprocessor
- the processorFsmException
- if the processor is already definedprotected Preprocessor.Processor findProcessor(Event event)
PreprocessorAdapter
findProcessor
in class PreprocessorAdapter
event
- the eventCopyright 2013 Michal Turek, AnotherFSM.