@Test public void testContextClosedEvent() throws Exception { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring-annotationEvent.xml"); ServiceComponent serviceComponent = context.getBean(ServiceComponent.class); serviceComponent.closeApplication(); }
public void closeApplication() { publisher.publishEvent(new CleanConnEvent(context)); }
ServiceComponent implements ApplicationEventPublisherAware, ApplicationContextAware { public void closeApplication() { publisher.publishEvent(new CleanConnEvent(context)); } }
ServiceComponent implements ApplicationEventPublisherAware, ApplicationContextAware { public void closeApplication() { publisher.publishEvent(new CleanConnEvent(context)); }  }
ServiceComponent implements ApplicationEventPublisherAware, ApplicationContextAware { public void closeApplication() { publisher.publishEvent(new CleanConnEvent(context)); }  @Override void setApplicationContext(ApplicationContext applicationContext); @Override void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher); void closeApplication(); }
ServiceComponent implements ApplicationEventPublisherAware, ApplicationContextAware { public void closeApplication() { publisher.publishEvent(new CleanConnEvent(context)); }  @Override void setApplicationContext(ApplicationContext applicationContext); @Override void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher); void closeApplication();  }