Examples of AbstractApplicationContext


Examples of org.springframework.context.support.AbstractApplicationContext

          + "\n    For more information please visit:                   "
          + "\n    http://www.springsource.org/spring-integration       "
          + "\n                                                         "
          + "\n=========================================================" );

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

    context.registerShutdownHook();

    final Scanner scanner = new Scanner(System.in);


    final PersonService personService = context.getBean(PersonService.class);

    LOGGER.info("\n========================================================="
          + "\n                                                         "
          + "\n    Please press 'q + Enter' to quit the application.    "
          + "\n                                                         "
View Full Code Here

Examples of org.springframework.context.support.AbstractApplicationContext

          + "\n  For more information please visit:           "
          + "\n  http://www.springsource.org/spring-integration     "
          + "\n                             "
          + "\n=========================================================" );

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

    LOGGER.info("\n========================================================="
          + "\n                              "
          + "\n  This is the TCP-AMQP Sample -             "
          + "\n                              "
          + "\n  Start a netcat, listening on port 11112 -       "
          + "\n  netcat -l 11112                     "
          + "\n                              "
          + "\n  In another terminal, telnet to localhost 11111    "
          + "\n  Enter text and you will see it echoed to the netcat   "
          + "\n                              "
          + "\n  Press Enter in this console to terminate        "
          + "\n                              "
          + "\n=========================================================" );

    System.in.read();
    context.close();
  }
View Full Code Here

Examples of org.springframework.context.support.AbstractApplicationContext

* @author Jonas Partner
*/
public class BookOrderProcessingTestApp {

  public static void main(String[] args) throws Exception {
    AbstractApplicationContext applicationContext =
      new ClassPathXmlApplicationContext("/META-INF/spring/integration/orderProcessingSample.xml",
        BookOrderProcessingTestApp.class);
    MessageChannel messageChannel = (MessageChannel) applicationContext.getBean("ordersChannel");
    GenericMessage<Document> orderMessage =
      createXmlMessageFromResource("META-INF/spring/integration/order.xml");
    messageChannel.send(orderMessage);
    applicationContext.close();
  }
View Full Code Here

Examples of org.springframework.context.support.AbstractApplicationContext

*
*/
public class Main {

  public static void main(String[] args) throws Exception {
    AbstractApplicationContext context = new ClassPathXmlApplicationContext(
        "META-INF/spring/integration/04-externalgateway/*.xml");
    System.out.println("Please enter zip");
   
    BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
    String zip = console.readLine().trim();
    WeatherAndTraffic weatherAndTraffic = context.getBean("wat", WeatherAndTraffic.class);
    List<String> result = weatherAndTraffic.getByZip(zip);
    System.out.println(result.get(0) + "\r\n" + result.get(1) + "\r\n");
    context.close();
    System.exit(0);
  }
View Full Code Here

Examples of org.springframework.context.support.AbstractApplicationContext

          + "\n    For more information please visit:                   "
          + "\n    http://www.springsource.org/spring-integration       "
          + "\n                                                         "
          + "\n=========================================================" );

    @SuppressWarnings("resource")
    final AbstractApplicationContext context =
        new ClassPathXmlApplicationContext("classpath:META-INF/spring/integration/spring-integration-confirms-context.xml");

    context.registerShutdownHook();

    LOGGER.info("\n========================================================="
          + "\n                                                          "
          + "\n    This is the AMQP Sample with confirms/returns -       "
          + "\n                                                          "
View Full Code Here

Examples of org.springframework.context.support.AbstractApplicationContext

          + "\n    For more information please visit:                   "
          + "\n    http://www.springsource.org/spring-integration       "
          + "\n                                                         "
          + "\n=========================================================" );

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

    context.registerShutdownHook();

    LOGGER.info("\n========================================================="
          + "\n                                                          "
          + "\n    This is the AMQP Sample -                             "
          + "\n                                                          "
View Full Code Here

Examples of org.springframework.context.support.AbstractApplicationContext

public class HelloWorldApp {

  private static Logger logger = Logger.getLogger(HelloWorldApp.class);

  public static void main(String[] args) {
    AbstractApplicationContext context = new ClassPathXmlApplicationContext("/META-INF/spring/integration/helloWorldDemo.xml", HelloWorldApp.class);
    MessageChannel inputChannel = context.getBean("inputChannel", MessageChannel.class);
    PollableChannel outputChannel = context.getBean("outputChannel", PollableChannel.class);
    inputChannel.send(new GenericMessage<String>("World"));
    logger.info("==> HelloWorldDemo: " + outputChannel.receive(0).getPayload());
  }
View Full Code Here

Examples of org.springframework.context.support.AbstractApplicationContext

 
  /**
   * @param args
   */
  public static void main(String[] args) {
    AbstractApplicationContext context = new ClassPathXmlApplicationContext(
        "/applicationContext-db4o.xml");
        Db4oService service = (Db4oService)context.getBean("db4oService");

        log.info("list of pilots before saving");
        service.listPilots();
        log.info("calling saveSmth");
        service.saveSmth();

        log.info("before saveWithRollback");
        try {
            service.saveWithRollback();
        } catch (RuntimeException e) {
            // it's okay
       
        log.info("after saveWithRollback");
        service.listPilots();
    context.close();
  }
View Full Code Here

Examples of org.springframework.context.support.AbstractApplicationContext

    public static void main(String[] args) {
       
      System.setProperty(LogFactory.FACTORY_PROPERTY, "org.apache.commons.logging.impl.Log4jFactory");
        PropertyConfigurator.configure("log4j.properties");
       
      AbstractApplicationContext context = new ClassPathXmlApplicationContext("/applicationContext-repository.xml");
       
        ResourceLoader loader = new DefaultResourceLoader();
        Resource resource = loader.getResource("test.file");
       
        JcrService service = (JcrService)context.getBean("jcrService");

        service.saveSmth();
       

        try {
            //service.saveWithRollback();
        } catch (RuntimeException e) {
            // it's okay
        }
       
        try {
          Thread.sleep(5000);
    }
    catch (InterruptedException e) {
      //
    }
        context.close();

    }
View Full Code Here

Examples of org.springframework.context.support.AbstractApplicationContext

   * @param args
   *            Command line arguments. This appliation does not check any of
   *            these arguments.
   */
  public static void main(String[] args) {
    AbstractApplicationContext ctx = ExampleUtils.getContext();
    ObjectContainer db = (ObjectContainer) ctx.getBean(ExampleUtils.CONTAINER_BEAN_ID);
    try {
      storeFirstPilot(db);
      storeSecondPilot(db);
      retrieveAllPilots(db);
      retrievePilotByName(db);
      retrievePilotByExactPoints(db);
      retrieveByNegation(db);
      retrieveByConjunction(db);
      retrieveByDisjunction(db);
      retrieveByComparison(db);
      retrieveByDefaultFieldValue(db);
      retrieveSorted(db);
      clearDatabase(db);
    } finally {
      ctx.close();
    }
  }
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.