Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void onStart(@Observes StartupEvent ev, CamelRuntime rt) {
- runtime = new FastApplicationRuntime(rt.getRegistry());
- runtime.setProperties(RuntimeSupport.loadProperties());
- runtime.addListeners(ServiceLoader.load(Runtime.Listener.class));
- new Thread(() -> {
- try {
- LOGGER.info("Starting Camel Runtime");
- runtime.run(false);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }).start();
- }
- void onStop(@Observes ShutdownEvent ev) {
- if (runtime != null) {
- try {
- LOGGER.info("Stopping Camel Runtime");
- runtime.stop();
- LOGGER.info("Camel Runtime stopped");
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement