Examples of FileSystemXmlApplicationContext


Examples of org.springframework.context.support.FileSystemXmlApplicationContext

    List<FacetHandler<?>> fConf=null;
   
    Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
    ApplicationContext appCtx=null;
    try{
      appCtx=new FileSystemXmlApplicationContext("file:"+fConfFile.getAbsolutePath());
      fConf =  (List<FacetHandler<?>>)appCtx.getBean("handlers");
    }
    catch(Exception e){
      throw new BuildException(e.getMessage(),e);
    }
View Full Code Here

Examples of org.springframework.context.support.FileSystemXmlApplicationContext

    ApplicationContext context = null;
   
  public void setUp() throws Exception{
   
   
    context = new FileSystemXmlApplicationContext(TEST_APP_CONTEXT);
   
  }
View Full Code Here

Examples of org.springframework.context.support.FileSystemXmlApplicationContext

     * DOCUMENT ME!
     *
     * @throws IOException DOCUMENT ME!
     */
    public void setUp() throws IOException {
        ac = new FileSystemXmlApplicationContext(
                "/net/fp/rp/search/ui/web/personalengine-servlet.xml");
    }
View Full Code Here

Examples of org.springframework.context.support.FileSystemXmlApplicationContext

    //The application context used by this test
    ApplicationContext context = null;
   
  public void setUp() throws Exception{
   
    context = new FileSystemXmlApplicationContext(TEST_APP_CONTEXT);
  }
View Full Code Here

Examples of org.springframework.context.support.FileSystemXmlApplicationContext

    ApplicationContext context = null;
   
  public void setUp() throws Exception{
   
   
    context = new FileSystemXmlApplicationContext(TEST_APP_CONTEXT);
   
  }
View Full Code Here

Examples of org.springframework.context.support.FileSystemXmlApplicationContext

     * Get the (Test) Context from the file
     */
  public void setUp() throws Exception{
   
   
    context = new FileSystemXmlApplicationContext(TEST_APP_CONTEXT);
   
  }
View Full Code Here

Examples of org.springframework.context.support.FileSystemXmlApplicationContext

    System.setProperty("rp.root","red-adaptive-search/tmp");
   
    File myFile = new File(".");
    log.debug(myFile.getAbsolutePath());
   
    ApplicationContext context = new FileSystemXmlApplicationContext(
        "red-adaptive-search/war/WEB-INF/simple/appContext.xml");

    // get the knowledgemanager
    knowledgeManager = (KnowledgeSphereManager) context
        .getBean(Config.KNOWLEDGEMANAGER_PLUGINNAME);

  }
View Full Code Here

Examples of org.springframework.context.support.FileSystemXmlApplicationContext

import org.springframework.context.support.FileSystemXmlApplicationContext;

public class Demo {
    public static void main(String[] args) {
        ApplicationContext ctx =
            new FileSystemXmlApplicationContext(
                    "resources/applicationContext.xml");
        Evaluator e = null;
        boolean ok;
       
        for (int i = 0; i < 10; i++) {
            e = (Evaluator) ctx.getBean("groovyEvaluator");
            ok = e.approve(null);
            System.out.println(ok ? "approved" : "denied");
           
            try {
                Thread.sleep(1000);
View Full Code Here

Examples of org.springframework.context.support.FileSystemXmlApplicationContext

  private static int timeout = 20;

  @Test
  public void testAsyncGateway() throws Exception{
    ConfigurableApplicationContext ac =
        new FileSystemXmlApplicationContext("src/main/resources/META-INF/spring/integration/*.xml");
    MathServiceGateway mathService = ac.getBean("mathService", MathServiceGateway.class);
    Map<Integer, Future<Integer>> results = new HashMap<Integer, Future<Integer>>();
    Random random = new Random();
    for (int i = 0; i < 100; i++) {
      int number = random.nextInt(200);
      Future<Integer> result = mathService.multiplyByTwo(number);
      results.put(number, result);
    }
    for (final Map.Entry<Integer, Future<Integer>> resultEntry : results.entrySet()) {
      executor.execute(() -> {
        int[] result = processFuture(resultEntry);

        if (result[1] == -1){
          logger.info("Multiplying " + result[0] + " should be easy. You should be able to multiply any number < 100 by 2 in your head");
        } else if (result[1] == -2){
          logger.info("Multiplication of " + result[0] + " by 2 is can not be accomplished in " + timeout + " seconds");
        } else {
          logger.info("Result of multiplication of " + result[0] + " by 2 is " + result[1]);
        }
      });
    }
    executor.shutdown();
    executor.awaitTermination(60, TimeUnit.SECONDS);
    logger.info("Finished");
    ac.close();
  }
View Full Code Here

Examples of org.springframework.context.support.FileSystemXmlApplicationContext

                fileTarget=target;

        if(fileTarget==null)
            throw new FileNotFoundException();

        ApplicationContext ctx=new FileSystemXmlApplicationContext(
            fileTarget
        );

        basekbNowFlow=ctx.getBean("basekbNowFlow",Flow.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.