-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This closes #73
- Loading branch information
Showing
3 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Lifecycle Support | ||
|
||
Each Sisu managed bean/component may optionally use annotations on methods to be called whenever the bean is started or stopped. | ||
|
||
Those are | ||
|
||
Annotation | Method called... | Leveraged Guice Hook | ||
--- | --- | ||
`org.eclipse.sisu.PostConstruct` (or `javax.annotation.PostConstruct`) | Before bean is started | [`com.google.inject.spi.InjectionListener.afterInjection(...)`](https://google.github.io/guice/api-docs/6.0.0/javadoc/com/google/inject/spi/InjectionListener.html#afterInjection(I)) | ||
`org.eclipse.sisu.PreDestroy` (or `javax.annotation.PreDestroy.`) | Before bean is stopped | Is not called by default, only via [Plexus API](../org.eclipse.sisu.plexus). | ||
|
||
The annotations defined in [JSR 250](https://jcp.org/en/jsr/detail?id=250) are recognized in addition to the native Sisu ones when their classes are detected in the class path. | ||
|
||
The support needs to be explicitly enabled by passing an instance of [`org.eclipse.sisu.bean.LifecycleModule`](apidocs/org/eclipse/sisu/bean/LifecycleModule.html) when creating the `Injector`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters