Skip to content

Instantly share code, notes, and snippets.

@splatch
Created June 27, 2012 12:38
Show Gist options
  • Select an option

  • Save splatch/3003832 to your computer and use it in GitHub Desktop.

Select an option

Save splatch/3003832 to your computer and use it in GitHub Desktop.
/**
* 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