Package org.springframework.context.event

Examples of org.springframework.context.event.ContextClosedEvent


        logger.info("Closing " + this);
      }

      try {
        // Publish shutdown event.
        publishEvent(new ContextClosedEvent(this));
      }
      catch (Throwable ex) {
        logger.warn("Exception thrown from ApplicationListener handling ContextClosedEvent", ex);
      }
View Full Code Here


      if (logger.isInfoEnabled()) {
        logger.info("Closing " + this);
      }
      try {
        // Publish shutdown event.
        publishEvent(new ContextClosedEvent(this));
      }
      catch (Throwable ex) {
        logger.error("Exception thrown from ApplicationListener handling ContextClosedEvent", ex);
      }
      // Stop all Lifecycle beans, to avoid delays during individual destruction.
View Full Code Here

    applicationContext.refresh();
    setUpApplicationContextFactories(jobPaths, applicationContext);
    registrar.setApplicationContext(applicationContext);
    registrar.start();
    assertEquals(2, registry.getJobNames().size());
    registrar.onApplicationEvent(new ContextClosedEvent(applicationContext));
    assertEquals(0, registry.getJobNames().size());

  }
View Full Code Here

      assertNotifiedWithEvent(testApplicationListenerOne, testContextRefreshedEvent);
      assertNotifiedWithEvent(testApplicationListenerTwo, testContextRefreshedEvent);
      assertUnnotified(testApplicationListenerThree);

      ContextClosedEvent testContextClosedEvent = new ContextClosedEvent(mockApplicationContext);

      initializer.onApplicationEvent(testContextClosedEvent);

      assertUnnotified(testApplicationListenerOne);
      assertUnnotified(testApplicationListenerTwo);
View Full Code Here

      assertFalse(declarable.isInitialized());
      assertFalse(doPostInitCalled.get());
    }
    finally {
      initializer.onApplicationEvent(new ContextClosedEvent(mockApplicationContext));
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.context.event.ContextClosedEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.