Below are a list of steps necessary to create a loadable Event Agent plugin. Order is not important and each step is not as simple as it sounds. This is merely a plugin API checklist.
- Derive your Event Agent from EventAgent
- Override all of the Component state transition methods:
- initialize
- Register plugin configuration items and an optional configuration validator
- Register plugin statistics and statistic tables
- Register plugin events of interest
- configure
- Process all loaded configuration
- start
- Emulation starts at the conclusion of this method. Do any startup logic.
- postStart
- All components in the NEM layer stack are now in the start state. Do any cross layer startup handshaking.
- stop
- Opposite of start. Do any tear down logic.
- destroy
- Opposite of initialize. Do any cleanup logic.
- If your plugin will be processing events you will need to override:
- If your plugin will be scheduling timed events you will need to override:
- Add the appropriate functionality to translate events
- Declare your plugin using DECLARE_EVENT_AGENT