Examples of AbstractApplicationContext


Examples of org.springframework.context.support.AbstractApplicationContext

* @author Tom McCuch
*/
public class CafeDemoAppOperationsAmqp {

  public static void main(String[] args) {
    AbstractApplicationContext context =
        CafeDemoAppUtilities.loadProfileContext(
          "/META-INF/spring/integration/amqp/cafeDemo-amqp-operations-xml.xml",
          CafeDemoAppOperationsAmqp.class,CafeDemoAppUtilities.DEV);
    System.out.println("Press Enter/Return in the console to exit the Cafe Operations App");

    try {
      System.in.read();
    }
    catch (IOException e) {
      context.close();
    }
    context.close();
  }
View Full Code Here

Examples of org.springframework.context.support.AbstractApplicationContext

      cafe.placeOrder(order);
    }
  }

  public static void main(String[] args) {
    AbstractApplicationContext context =
      CafeDemoAppUtilities.loadProfileContext(
          "/META-INF/spring/integration/amqp/cafeDemo-amqp-xml.xml",
          CafeDemoAppAmqp.class,CafeDemoAppUtilities.DEV);
    order(context, 100);
    context.close();
  }
View Full Code Here

Examples of org.springframework.context.support.AbstractApplicationContext

* @author Tom McCuch
*/
public class CafeDemoAppBaristaHotAmqp {

  public static void main(String[] args) {
    AbstractApplicationContext context =
        CafeDemoAppUtilities.loadProfileContext(
          "/META-INF/spring/integration/amqp/cafeDemo-amqp-baristaHot-xml.xml",
          CafeDemoAppBaristaHotAmqp.class,CafeDemoAppUtilities.DEV);

    System.out.println("Press Enter/Return in the console to exit the Barista Hot App");

    try {
      System.in.read();
    }
    catch (IOException e) {
      context.close();
    }
    context.close();
  }
View Full Code Here

Examples of org.springframework.context.support.AbstractApplicationContext

* @author Tom McCuch
*/
public class CafeDemoAppBaristaColdAmqp {

  public static void main(String[] args) {
    AbstractApplicationContext context =
      CafeDemoAppUtilities.loadProfileContext(
        "/META-INF/spring/integration/amqp/cafeDemo-amqp-baristaCold-xml.xml",
        CafeDemoAppBaristaColdAmqp.class,CafeDemoAppUtilities.DEV);

    System.out.println("Press Enter/Return in the console to exit the Barista Cold App");

    try {
      System.in.read();
    }
    catch (IOException e) {
      context.close();
    }

    context.close();
  }
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");

        context.registerShutdownHook();

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

        final DynamicPeriodicTrigger trigger = context.getBean(DynamicPeriodicTrigger.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

public class ControlBusMain {
  private static Logger logger = Logger.getLogger(ControlBusMain.class);
  public static void main(String[] args)  {
  
    AbstractApplicationContext context =
      new ClassPathXmlApplicationContext("/META-INF/spring/integration/cafeDemo-control-bus.xml");
   
      WaiterMonitor waiterMonitor = (WaiterMonitor) context.getBean("waiterMonitor");
      
      int totalDeliveries = 0;
      while (totalDeliveries <= 3) {
        try {
          Thread.sleep(1000);
        }
        catch (InterruptedException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
       
        totalDeliveries = (Integer)waiterMonitor.sendControlScript("waiter.totalDeliveries");
       
        logger.info("Total cafe deliveries: " + totalDeliveries);
       
        if (totalDeliveries > 3) {
          logger.info("stopping orders...");
          waiterMonitor.sendControlScript("cafe.stop()");
          logger.info("orders stopped");
        }
      }
      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=========================================================" );

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

    context.registerShutdownHook();

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

    final StringConversionService service = context.getBean(StringConversionService.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

* @author Marius Bogoevici
*/
public class CafeDemoApp {

  public static void main(String[] args) {
    AbstractApplicationContext context =
      new ClassPathXmlApplicationContext("/META-INF/spring/integration/cafeDemo-annotation.xml", CafeDemoApp.class);

    Cafe cafe = (Cafe) context.getBean("cafe");
    for (int i = 1; i <= 100; i++) {
      Order order = new Order(i);
      order.addItem(DrinkType.LATTE, 2, false);
      order.addItem(DrinkType.MOCHA, 3, true);
      cafe.placeOrder(order);
    }
    context.close();
  }
View Full Code Here

Examples of org.springframework.context.support.AbstractApplicationContext

* @author Oleg Zhurakousky
*/
public class CafeDemoApp {

  public static void main(String[] args) {
    AbstractApplicationContext context =
      new ClassPathXmlApplicationContext("/META-INF/spring/integration/cafeDemo-xml.xml", CafeDemoApp.class);

    Cafe cafe = (Cafe) context.getBean("cafe");
    for (int i = 1; i <= 100; i++) {
      Order order = new Order(i);
      order.addItem(DrinkType.LATTE, 2, false);
      order.addItem(DrinkType.MOCHA, 3, true);
      cafe.placeOrder(order);
    }
    context.close();
  }
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"
          + HORIZONTAL_LINE );

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

    context.registerShutdownHook();

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

    LOGGER.info(HORIZONTAL_LINE
          + "\n"
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.