Created
June 27, 2012 12:38
-
-
Save splatch/3003832 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /** | |
| * Very simple life cycle adapter to call start/stop camel services. | |
| */ | |
| public class CdiLifecycleAdapter { | |
| @Inject | |
| private Instance<Service> services; | |
| void startUp(@Observes AfterDeploymentValidation abd) throws Exception { | |
| for (Service reference : services) { | |
| reference.start(); | |
| } | |
| } | |
| void shutDown(@Observes BeforeShutdown bs) throws Exception { | |
| for (Service reference : services) { | |
| reference.stop(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment