Package org.springframework.context.support

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


            Customer customer = customerService.getCustomer("12345");
            assertNotNull("We should get Customer here", customer);
        } finally {
            if (clientContext != null) {
                clientContext.destroy();
            }
            if (serverContext != null) {
                serverContext.destroy();
            }
        }
View Full Code Here


            Customer customer = customerService.getCustomer("12345");
            assertNotNull("We should get Customer here", customer);
        } finally {
            if (clientContext != null) {
                clientContext.destroy();
            }
            if (serverContext != null) {
                serverContext.destroy();
            }
        }
View Full Code Here

      ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"spring-jms-beans.xml"});
      MessageSender sender = (MessageSender)context.getBean("MessageSender");
      System.out.println("Sending message...");
      sender.send("Hello world");
      Thread.sleep(100);
      context.destroy();
   }
}
View Full Code Here

        String rc = proxy.say();
        assertEquals("Hello", rc);
        // END SNIPPET: invoke

        camelContext.stop();
        applicationContext.destroy();
    }

    protected ClassPathXmlApplicationContext createApplicationContext() {
        return new ClassPathXmlApplicationContext("org/apache/camel/spring/remoting/spring.xml");
    }
View Full Code Here

           
            Customer customer = customerService.getCustomer("12345");
            assertNotNull("We should get Customer here", customer);
        } finally {
            if (clientContext != null) {
                clientContext.destroy();
            }
            if (serverContext != null) {
                serverContext.destroy();
            }
        }
View Full Code Here

  public void destroyLazyInitSchedulerWithDefaultShutdownOrderDoesNotHang() {
    AbstractApplicationContext context = new ClassPathXmlApplicationContext("quartzSchedulerLifecycleTests.xml", this.getClass());
    assertNotNull(context.getBean("lazyInitSchedulerWithDefaultShutdownOrder"));
    StopWatch sw = new StopWatch();
    sw.start("lazyScheduler");
    context.destroy();
    sw.stop();
    assertTrue("Quartz Scheduler with lazy-init is hanging on destruction: " +
        sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 500);
  }
View Full Code Here

  public void destroyLazyInitSchedulerWithCustomShutdownOrderDoesNotHang() {
    AbstractApplicationContext context = new ClassPathXmlApplicationContext("quartzSchedulerLifecycleTests.xml", this.getClass());
    assertNotNull(context.getBean("lazyInitSchedulerWithCustomShutdownOrder"));
    StopWatch sw = new StopWatch();
    sw.start("lazyScheduler");
    context.destroy();
    sw.stop();
    assertTrue("Quartz Scheduler with lazy-init is hanging on destruction: " +
        sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 500);
  }
View Full Code Here

            ctx.start();
            ServiceConfig serviceConfig = (ServiceConfig) ctx.getBean("dubboDemoService");
            URL url = (URL)serviceConfig.getExportedUrls().get(0);
            Assert.assertEquals(Constants.GENERIC_SERIALIZATION_BEAN, url.getParameter(Constants.GENERIC_KEY));
        } finally {
            ctx.destroy();
        }
    }

    private static void unexportService(ServiceConfig<?> config) {
        if (config != null) {
View Full Code Here

            new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/systest/bus/servlet.xml"});
        Bus bus = new SpringBusFactory(ctx).createBus();
        checkBindingExtensions(bus);
        checkHTTPTransportFactories(bus);
        checkOtherCoreExtensions(bus);
        ctx.destroy();
    }
    @Test
    public void testLoadBusWithApplicationContext() throws BusException {
        ClassPathXmlApplicationContext ctx =
            new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/systest/bus/basic.xml"});
View Full Code Here

        ctx.refresh();
        bus = ctx.getBean("cxf", Bus.class);
        checkBindingExtensions(bus);
        checkHTTPTransportFactories(bus);
        checkOtherCoreExtensions(bus);
        ctx.destroy();
    }
   
    private void checkBindingExtensions(Bus bus) throws BusException {
        BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class)
        assertNotNull("No binding factory manager", bfm);
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.