Examples of GenericXmlApplicationContext


Examples of org.springframework.context.support.GenericXmlApplicationContext

  private String beanName;
 
  private String methodName;
 
  public SpringSlimRunner(String resources) {
    this.context = new GenericXmlApplicationContext(resources);
  }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

        ServiceAuthenticationDetails details = loadServiceAuthenticationDetails("defaultserviceauthenticationdetails-explicit.xml");
        assertEquals("https://example.com/cas-sample/secure/", details.getServiceUrl());
    }

    private ServiceAuthenticationDetails loadServiceAuthenticationDetails(String resourceName) {
        context = new GenericXmlApplicationContext(getClass(), resourceName);
        ServiceAuthenticationDetailsSource source = context.getBean(ServiceAuthenticationDetailsSource.class);
        return source.buildDetails(request);
    }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

        }
    }

    @Test
    public void methodExpressionHandlerInParentContextLoads() {
        parent = new GenericXmlApplicationContext("org/springframework/security/config/method/sec2499/parent.xml");
        child = new GenericXmlApplicationContext();
        child.load("org/springframework/security/config/method/sec2499/child.xml");
        child.setParent(parent);
        child.refresh();
    }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

  private static Logger log = Logger.getLogger(SpringConfigurationHelper.class.getName());

  public static ProcessEngine buildProcessEngine(URL resource) {
    log.fine("==== BUILDING SPRING APPLICATION CONTEXT AND PROCESS ENGINE =========================================");
   
    ApplicationContext applicationContext = new GenericXmlApplicationContext(new UrlResource(resource));
    Map<String, ProcessEngine> beansOfType = applicationContext.getBeansOfType(ProcessEngine.class);
    if ( (beansOfType==null)
         || (beansOfType.isEmpty())
       ) {
      throw new ProcessEngineException("no "+ProcessEngine.class.getName()+" defined in the application context "+resource.toString());
    }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

    }
  }

  @Test
  public void testMultiThreadedBatch() throws Exception {
    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(
        "/org/springframework/data/hadoop/batch/multi-thread.xml");

    ctx.registerShutdownHook();

    JobsTrigger.startJobs(ctx);
  }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

  }

  @Test
  public void testWorkflow() throws Exception {

    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(
        "/org/springframework/data/hadoop/batch/in-do-out.xml");

    ctx.registerShutdownHook();

    FileSystem fs = FileSystem.get(ctx.getBean(Configuration.class));
    System.out.println("FS is " + fs.getClass().getName());
    HdfsResourceLoader hrl = ctx.getBean(HdfsResourceLoader.class);
    Resource resource = hrl.getResource("/ide-test/output/word/");

    assertTrue(ctx.isPrototype("script-tasklet"));

    fs.delete(new Path(resource.getURI().toString()), true);

    JobsTrigger.startJobs(ctx);

    Path p = new Path("/ide-test/output/word/");
    Job job = (Job) ctx.getBean("mr-job");
    Configuration c = job.getConfiguration();
    FileSystem fs2 = p.getFileSystem(c);
    System.out.println("FS is " + fs2.getClass().getName());

    fs2.exists(p);

    ctx.close();
  }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

  }


  @Test
  public void executePOC() throws Exception {
    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(
        "/org/springframework/data/hadoop/poc/context.xml");

    ctx.registerShutdownHook();

    FileSystem fs = FileSystem.get(ctx.getBean(Configuration.class));
    fs.delete(new Path("/logs/output/"), true);
    fs.delete(new Path("/logs/output/stream"), true);


    Thread.sleep(1000 * 15);
    ctx.close();
  }
 
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

    ctx.close();
  }

  @Test
  public void testWorkflowNS() throws Exception {
    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(
        "/org/springframework/data/hadoop/batch/in-do-out-ns.xml");

    ctx.registerShutdownHook();

    FileSystem fs = FileSystem.get(ctx.getBean(Configuration.class));
    fs.delete(new Path("/ide-test/output/word/"), true);

    assertTrue(ctx.isPrototype("hadoop-tasklet"));

    JobsTrigger.startJobs(ctx);
    ctx.close();
  }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

  /**
   * @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);
   
    List<Category> categories = categoryService.findAll();
   
    for (Category category: categories) System.out.println("Category: " + category.getCategoryId());
   
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

  /**
   * @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);
   
    PageRequest pageRequest = new PageRequest(0, 10);

    String subject = "%";
    String categoryId = "Spring";
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.