@Override protected List<Class<?>> annotatedClasses() { List<Class<?>> classes = super.annotatedClasses(); classes.add(StandaloneConfiguration.class); return classes; }
@Override protected void initialize() { super.initialize(); this.initializeContext(); }
@Override protected void doStop() throws Exception { if (! stopped) { LoggerFactory.getLogger(this.getClass()).info("Shutting-down {}...", name()); try { node().stop(); } catch (Exception ex) { LoggerFactory.getLogger(this.getClass()).error("Unexpected error", ex); } finally { ctx.close(); stopped = true; } } }
@Override protected List<Class<?>> annotatedClasses() { List<Class<?>> classes = super.annotatedClasses(); classes.add(StandaloneConfiguration.class); return classes; }
@Override protected List<Class<?>> annotatedClasses() { List<Class<?>> classes = super.annotatedClasses(); classes.add(StandaloneConfiguration.class); return classes; }
@Override protected List<Class<?>> annotatedClasses() { List<Class<?>> classes = super.annotatedClasses(); classes.add(StandaloneConfiguration.class); return classes; }
@Override protected List<Class<?>> annotatedClasses() { List<Class<?>> classes = super.annotatedClasses(); classes.add(StandaloneConfiguration.class); return classes; }
protected void initializeContext() { ctx = new AnnotationConfigApplicationContext(); List<Class<?>> classes = annotatedClasses(); classes.forEach(aClass -> ((AnnotationConfigApplicationContext)ctx).register(aClass)); // Finally refresh the context ctx.refresh(); }