Package org.springframework.context.support

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


  public static void main(String[] args) throws Exception {

    Topic request = new ActiveMQTopic("request");
    for (int i = 0; i < 100; i++) {
      ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("context.xml");
      ctx.start();
     
      Connection conn = null;
      Session requestSession = null;
      try {
        ConnectionFactory connFactory = (ConnectionFactory)ctx.getBean("connectionFactory");
View Full Code Here


      }

      server.addConnector(apiConnector);

      server.setStopAtShutdown(true);
      springAppContext.start();

      String osType = configuration.getServerOsType();
      if (osType == null || osType.isEmpty()) {
        throw new RuntimeException(Configuration.OS_VERSION_KEY + " is not "
            + " set in the ambari.properties file");
View Full Code Here

    FakeReporter two = null;
    try {
      final MetricRegistry registry = SharedMetricRegistries.getOrCreate("reporterTestRegistry");

      ctx = new ClassPathXmlApplicationContext("classpath:fake-reporter-test.xml");
      ctx.start();

      Thread.sleep(1000);

      one = ctx.getBean("fakeReporterOne", FakeReporter.class);
      Assert.assertFalse(AopUtils.isAopProxy(one.getRegistry()));
View Full Code Here

        test.setUseRouteBuilder(false);

        final ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(classpathUri);
        test.setCamelContextService(new Service() {
            public void start() throws Exception {
                applicationContext.start();

            }

            public void stop() throws Exception {
                applicationContext.stop();
View Full Code Here

 
  public static void main(String[] args) throws InterruptedException {
    AbstractApplicationContext springContext =
                new ClassPathXmlApplicationContext("META-INF/spring/spring-camel-context.xml");

        springContext.start();
        Thread.sleep(10000);
        springContext.stop();

  }
View Full Code Here

    @Test(expected = BeanCreationException.class)
    public void testInvalidTransactionManagerFails() {
        ClassPathXmlApplicationContext ctx = null;
        try {
            ctx = new ClassPathXmlApplicationContext("classpath:org/springframework/data/neo4j/config/ConfigurationConfirmationTests-context.xml");
            ctx.start();
        } finally {
            if (ctx != null) {
                ctx.close();
            }
        }
View Full Code Here

public class SplunkOutboundChannelAdapterTcpSample {

  public static void main(String args[]) {
    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
        "SplunkOutboundChannelAdapterTcpSample-context.xml", SplunkOutboundChannelAdapterTcpSample.class);
    ctx.start();

    SubscribableChannel channel = ctx.getBean("outputToSplunk", SubscribableChannel.class);

    SplunkData data = new SplunkData("spring", "spring:example");
    data.setCommonDesc("description");
View Full Code Here

public class SplunkOutboundChannelAdapterStreamSample {

  public static void main(String args[]) {
    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
        "SplunkOutboundChannelAdapterStreamSample-context.xml", SplunkOutboundChannelAdapterStreamSample.class);
    ctx.start();

    SubscribableChannel channel = ctx.getBean("outputToSplunk", SubscribableChannel.class);

    SplunkData data = new SplunkData("spring", "spring:example");
    data.setCommonDesc("description");
View Full Code Here

public class SplunkOutboundChannelAdapterSubmitSample {

  public static void main(String args[]) {
    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
        "SplunkOutboundChannelAdapterSubmitSample-context.xml", SplunkOutboundChannelAdapterSubmitSample.class);
    ctx.start();

    generateMessage(ctx);
  }

  private static void generateMessage(ClassPathXmlApplicationContext ctx) {
View Full Code Here

public class SplunkInboundChannelAdapterBlockingSample {

  public static void main(String args[]) {
    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
        "SplunkInboundChannelAdapterBlockingSample-context.xml", SplunkInboundChannelAdapterBlockingSample.class);
    ctx.start();
  }
}
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.