-
Notifications
You must be signed in to change notification settings - Fork 5
Plugin life cycle
Pierre T. edited this page Jan 9, 2015
·
1 revision
The plugin life cycle is composed of 3 steps:
- init
- start
- stop
Notice that each step is done for all the plugins before moving to another step. The order between plugin is determined according to their Dependencies.
The init is used to compute request results (see Request API). These computation could then be used to provide class to scan to the native module.
@Override
public InitState init(InitContext initContext) {
...
return InitState.INITIALIZED;
}
The init step should return
InitState.INITIALIZED
, otherwise theinit()
method will be called again. This allows to have Multi-round plugins.
At the start step the injection binding is done. This means that, you can use it in the plugin as all the plugins are bind by default.
@Inject
private MyPluginService service;
@Override
public void start() {
service.doSomeStuff();
logger.info("MyPlugin is starting");
}
This step is used to clean up the resources owned by the plugin before the kernel stop.
@Override
public void stop() {
logger.info("MyPlugin is stopping");
}
- Introduction
- ... Motivation
- ... Features
- ... Manifesto
- User manual
- ... Kernel
- ...... Kernel Life Cycle
- ...... Kernel Configuration
- ... Plugin
- ...... Plugin Life cycle
- ...... Request API
- ...... Native Module
- ...... Dependencies
- ... Tests
- ...... Integration Tests
- Advanced topics
- ... Design Best Practices
- ... Multi-Round Plugin
- ... Kernel param aliases
- ... SPI
- ...... DI Provider
- ...... Concern
- ...... Extension
- Definitions
- ... Framework
- ... Entreprise Stack
- ... API
- ... SPI
- ... Library
- ... Inversion of Control
- ... Dependency Injection
- Concepts
- ... UnitModule
- ... GlobalModule
- ... ObjectGraph