-
Notifications
You must be signed in to change notification settings - Fork 5
Extension
Pierre T. edited this page Apr 30, 2015
·
2 revisions
Kernel extensions provide an SPI to enhanced the kernel behavior.
-
Create a class implementing the
KernelExtension
interface -
Create a marker interface associated to the extension as follows:
-
Register the extension using the service loader. Add a file
io.nuun.kernel.spi.KernelExtension
underMETA-INF/services
.
public class MyFeatureExtension implements KernelExtension<MyFeature> {
@Override
public void initializing(Collection<MyExtensionInterface> extensions) {
...
}
@Override
public void initialized(Collection<MyExtensionInterface> extensions) {
...
}
@Override
public void starting(Collection<MyExtensionInterface> extensions) {
..
}
@Override
public void started(Collection<MyExtensionInterface> extensions) {
...
}
@Override
public void stopping(Collection<MyExtensionInterface> extensions) {
...
}
@Override
public void stopped(Collection<MyExtensionInterface> extensions) {
...
}
}
public interface MyFeature {
...
}
Create a plugin implementing the extension marker.
public class MyPlugin extends AbstractPlugin implements MyFeature {
...
}
The kernel extension will be called at each step of the kernel lifecycle (initializing, initialized, starting, etc.). The list of plugins implementing the kernel extension marker will be passed to the kernel extension at each method call.
See the kernel-listener extension.
- 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