Examples of registerShutdownHook()


Examples of org.springframework.context.support.AbstractApplicationContext.registerShutdownHook()

          + "\n=========================================================" );

    final AbstractApplicationContext context =
        new ClassPathXmlApplicationContext("classpath:META-INF/spring/integration/expression-advice-context.xml");

    context.registerShutdownHook();

    @SuppressWarnings("unchecked")
    SessionFactory<FTPFile> sessionFactory = context.getBean(SessionFactory.class);
    SourcePollingChannelAdapter fileInbound = context.getBean(SourcePollingChannelAdapter.class);
View Full Code Here

Examples of org.springframework.context.support.AbstractXmlApplicationContext.registerShutdownHook()

   *            the names of the contexts to load. If empty or
   *            <code>null</code>, the default context will be loaded instead.
   */
  public static void main(String[] args) {
    AbstractXmlApplicationContext context = createContext(args);
    context.registerShutdownHook();
    context.afterPropertiesSet();
  }

  private static AbstractXmlApplicationContext createContext(String[] args) {
    if (args != null && args.length > 0)
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext.registerShutdownHook()

                           String[] ctx = { dempsyConfig, clusterManager, transport, serializer, "testDempsy/" + applicationContext };

                           logger.debug("Starting up the appliction context ...");
                           ClassPathXmlApplicationContext actx = new ClassPathXmlApplicationContext(ctx);
                           actx.registerShutdownHook();

                           Dempsy dempsy = (Dempsy)actx.getBean("dempsy");

                           assertTrue(pass,TestUtils.waitForClustersToBeInitialized(baseTimeoutMillis, dempsy));
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext.registerShutdownHook()

            "testDempsy/Transport-PassthroughActx.xml",
            "testDempsy/ClusterInfo-LocalActx.xml",
            "testDempsy/Serializer-KryoActx.xml",
            "testDempsy/SimpleMultistageApplicationActx.xml"
            );
      actx.registerShutdownHook();
     
      Dempsy dempsy = (Dempsy)actx.getBean("dempsy");
      assertNotNull(dempsy);
     
      Dempsy.Application.Cluster cluster = dempsy.getCluster(new ClusterId("test-app", "test-cluster0"));
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext.registerShutdownHook()

               "testDempsy/Transport-TcpNoBatchingActx.xml",
               "testDempsy/ClusterInfo-LocalActx.xml",
               "testDempsy/Serializer-KryoActx.xml",
               "testDempsy/SimpleMultistageApplicationWithExecutorActx.xml"
               );
         actx.registerShutdownHook();

         Dempsy dempsy = (Dempsy)actx.getBean("dempsy");
         for (Dempsy.Application.Cluster cluster : dempsy.applications.get(0).appClusters)
         {
            // get the receiver from the node
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext.registerShutdownHook()

               "testDempsy/Transport-PassthroughActx.xml",
               "testDempsy/ClusterInfo-LocalActx.xml",
               "testDempsy/Serializer-KryoActx.xml",
               "testDempsy/SimpleMultistageApplicationActx.xml"
               );
         actx.registerShutdownHook();
      }
      catch (Throwable th)
      {
         assertEquals("Forced RuntimeException",th.getCause().getLocalizedMessage());
         gotException = true;
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext.registerShutdownHook()

      try
      {  
         logger.debug("Starting up the appliction context ...");
         actx = new ClassPathXmlApplicationContext(ctx);
         actx.registerShutdownHook();

         dempsy = (Dempsy)actx.getBean("dempsy");
         dempsy.start();

         final FullApplication app = (FullApplication)actx.getBean("app");
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext.registerShutdownHook()

      try
      {  
         logger.debug("Starting up the appliction context ...");
         actx = new ClassPathXmlApplicationContext(ctx);
         actx.registerShutdownHook();

         final FullApplication app = (FullApplication)actx.getBean("app");

         dempsy = (Dempsy)actx.getBean("dempsy");
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext.registerShutdownHook()

     
      try
      {
         logger.debug("Starting up the appliction context ...");
         actx = new ClassPathXmlApplicationContext(ctx);
         actx.registerShutdownHook();

         final FullApplication app = (FullApplication)actx.getBean("app");

         dempsy = (Dempsy)actx.getBean("dempsy");
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext.registerShutdownHook()

      ClassPathXmlApplicationContext context = null;
      try
      {
         // Initialize Spring
         context = new ClassPathXmlApplicationContext(new String[] {appCtxFilename, contextFile});
         context.registerShutdownHook();
      }
      catch(Throwable e)
      {
         logger.error(MarkerFactory.getMarker("FATAL"), "Failed to start the application ", e);
         throw e;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.