@PreDestroy public void destroy() { destroyed.incrementAndGet(); instance.set(null); System.err.println("Destroying Hello instance"); synchronized (instance) { instance.notifyAll(); } }
@PostConstruct public void init() { created.incrementAndGet(); instance.set(this); System.err.println("Creating Hello instance"); synchronized (instance) { instance.notifyAll(); } }