Package org.springframework.context.support

Examples of org.springframework.context.support.GenericXmlApplicationContext.load()


        System.out.println("Invalid choice\n\n");
        System.out.print("Enter you choice: ");
      }
    }

    context.load("classpath:META-INF/spring/integration/*-context.xml");
    context.registerShutdownHook();
    context.refresh();

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

View Full Code Here


    if (mapQuestApiKeyDefined) {
      env.setActiveProfiles("mapquest");
    }

    context.load("classpath:META-INF/spring/*.xml");
    context.refresh();

    final TravelGateway travelGateway = context.getBean("travelGateway", TravelGateway.class);

    final Scanner scanner = new Scanner(System.in);
View Full Code Here

   */
  public static AbstractApplicationContext loadProfileContext(String path, Class<?> targetClass, String profile) {
    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.getEnvironment().setActiveProfiles(profile);
    ctx.setClassLoader(targetClass.getClassLoader());
    ctx.load(path);
    ctx.refresh();
    return ctx;
  }

}
View Full Code Here

    context.getEnvironment().getPropertySources().addLast(propertySource);

    System.out.println("using port " + context.getEnvironment().getProperty("availableServerSocket"));

    context.load("classpath:META-INF/spring/integration/tcpClientServerDemo-context.xml");
    context.registerShutdownHook();
    context.refresh();

    return context;
  }
View Full Code Here

  private static void executeSample1() {

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

    final GenericXmlApplicationContext context = new GenericXmlApplicationContext();
    context.load("classpath:META-INF/spring/integration/spring-integration-sample1-context.xml");
    context.registerShutdownHook();
    context.refresh();

    final StringConversionService service = context.getBean(StringConversionService.class);
View Full Code Here

  private static void executeSample2() {

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

    final GenericXmlApplicationContext context = new GenericXmlApplicationContext();
    context.load("classpath:META-INF/spring/integration/spring-integration-sample2-context.xml");
    context.registerShutdownHook();
    context.refresh();

    final CoffeeService service = context.getBean(CoffeeService.class);
View Full Code Here

        System.out.println("Invalid choice\n\n");
        System.out.print("Enter you choice: ");
      }
    }

    context.load("classpath:META-INF/spring/integration/*-context.xml");
    context.registerShutdownHook();
    context.refresh();

    final ConnectionBroker connectionBroker = context.getBean(ConnectionBroker.class);

View Full Code Here

   * @param args
   */
  public static void main(String[] args) {

    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:mybatis-app-context.xml");
    ctx.refresh();
   
    System.out.println("App context initialized successfully");   
   
    EntryService entryService = ctx.getBean("entryService", EntryService.class);
View Full Code Here

   * @param args
   */
  public static void main(String[] args) {

    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:mybatis-app-context.xml");
    ctx.refresh();
   
    System.out.println("App context initialized successfully");       

    CategoryService categoryService = ctx.getBean("categoryService", CategoryService.class);
View Full Code Here

   * @param args
   */
  public static void main(String[] args) {

    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:jpa-app-context.xml");
    ctx.refresh();
   
    System.out.println("App context initialized successfully");
   
    EntryService entryService = ctx.getBean("entryService", EntryService.class);
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.