List of usage examples for org.springframework.context.event ApplicationContextEvent getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:org.alfresco.bm.test.LifecycleController.java
@Override public void onApplicationEvent(ApplicationContextEvent event) { // Ignore events from different application contexts if (event.getApplicationContext() != ctx) { // Ignore return;/* ww w.j a v a 2s .c om*/ } String eventName = event.getClass().getSimpleName(); if (eventName.equals("ContextRefreshedEvent")) { // Only start once if (!started) { start(); started = true; } } else if (eventName.equals("ContextClosedEvent")) { // Only stop once if (started) { stop(); started = false; } } }