Package org.springframework.context

Examples of org.springframework.context.ApplicationContext


    }
  }

  @Test
  public void testChecksSourceFirst() throws Exception {
    ApplicationContext ac = loadApplicationContext("/org/geomajas/spring/dependencyTestSourceFirst.xml");
    TestRecorder recorder = ac.getBean(TestRecorder.class);
    Assert.assertEquals("", recorder.matches(DependencyCheckPostProcessor.GROUP,
        DependencyCheckPostProcessor.VALUE));
  }
View Full Code Here


        DependencyCheckPostProcessor.VALUE));
  }

  @Test
  public void testChecksSourceLast() throws Exception {
    ApplicationContext ac = loadApplicationContext("/org/geomajas/spring/dependencyTestSourceLast.xml");
    TestRecorder recorder = ac.getBean(TestRecorder.class);
    Assert.assertEquals("", recorder.matches(DependencyCheckPostProcessor.GROUP,
        DependencyCheckPostProcessor.VALUE));
  }
View Full Code Here

    super.init(config);
    log.info("JSON servlet init");
    log.debug("current working directory = {}", System.getProperty("user.dir"));

    ApplicationContext applicationContext = ApplicationContextUtil.getApplicationContext(config);
    if (null == applicationContext) {
      applicationContext = ContextLoaderListener.getCurrentWebApplicationContext();
    }
    if (applicationContext instanceof ConfigurableApplicationContext) {
      ((ConfigurableApplicationContext) applicationContext).addApplicationListener(this);
View Full Code Here

  public DtoGeometrySerializerTest() {
    dtoSerializer = new DtoGeometrySerializer();
    jtsSerializer = new GeometrySerializer();

    ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] {
        "org/geomajas/spring/geomajasContext.xml", "org/geomajas/spring/emptyApplication.xml" });
    converter = applicationContext.getBean("service.DtoConverterService", DtoConverterService.class);
  }
View Full Code Here

   }

   @Test
   public void validateTypeMappingsExistInSpring()
   {
      ApplicationContext ctx = new ClassPathXmlApplicationContext("spring-typemapping-test-server.xml");
      SynchronousDispatcher dispatcher = (SynchronousDispatcher) ctx.getBean("resteasy.dispatcher");
      Map<String, MediaType> mappings = dispatcher.getMediaTypeMappings();
      assertEquals(2, mappings.size());
      assertEquals("application/xml", mappings.get("xml").toString());
      assertEquals("application/json", mappings.get("json").toString());
   }
View Full Code Here

    Object bean = null;
    synchronized (getConversation()) {
      Map<String, Object> registry = getViewRegistry();
      if (!registry.containsKey(name)) {
        if (GroovyBeanFactory.getInstance().getBeans().contains(name)) {
          ApplicationContext applicationContext = Application.getApplicationContext();
          registry.put(name, applicationContext.getBean(name));
        }
      }
      bean = registry.get(name);
    }
    return bean;
View Full Code Here

     
          if (AuthLevelmanagement.getInstance().checkWebServiceLevel(User_level)){
           
        String current_dir = getServletContext().getRealPath("/");
       
        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
            FileProcessor fileProcessor = (FileProcessor) context.getBean("openmeetings.FileProcessor");
       
            URL url = new URL(path);
            URLConnection uc = url.openConnection();
            InputStream inputstream = new BufferedInputStream(uc.getInputStream());
           
View Full Code Here

     
          if (AuthLevelmanagement.getInstance().checkWebServiceLevel(User_level)){
           
        String current_dir = getServletContext().getRealPath("/");
       
        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
            FileProcessor fileProcessor = (FileProcessor) context.getBean("openmeetings.FileProcessor");
       
            URL url = new URL(path);
            URLConnection uc = url.openConnection();
            InputStream inputstream = new BufferedInputStream(uc.getInputStream());
           
View Full Code Here

                "utf-8");
        InputStream is = upload.getFileContents("Filedata");
        String fileSystemName = upload.getBaseFilename("Filedata");
        log.debug("fileSystemName: " + fileSystemName);

        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
       
        FileProcessor fileProcessor = (FileProcessor) context.getBean("openmeetings.FileProcessor");
       
        HashMap<String, HashMap<String, Object>> returnError = fileProcessor.processFile(userId, room_id_to_Store,
            isOwner, is, parentFolderId, fileSystemName, current_dir, hs,
            0L, ""); //externalFilesId, externalType
       
View Full Code Here

public class HVAC {

    public static void main(String args[]) throws Exception {

        final ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
                "org/drools/spring/examples/jiahvac/control/hvac.appctx.xml");

        final WorkingMemory workingMemory =
                (WorkingMemory) applicationContext.getBean("workingMemory");
       
        final Simulator simulator =
                (Simulator) applicationContext.getBean("simulator");
       
        final TempuratureControl control =
                (TempuratureControl) applicationContext.getBean("tempuratureControl");

        workingMemory.assertObject(control);

        for (Floor floor : simulator.getFloors()) {
            workingMemory.assertObject(floor.getThermometer(), true);
            workingMemory.assertObject(floor.getVent(), true);
        }
        for (HeatPump pump : simulator.getHeatPumps()) {
            workingMemory.assertObject(pump, true);
        }
        System.out.println("---- begin initial fireAllRules");
        workingMemory.fireAllRules();
        System.out.println("---- end initial fireAllRules");

        // The 'executor' bean is lazy-init so we can control when the simulator starts
        // (which is now). Alternatively, we could have defined a start method to begin
        // the simulation.
        applicationContext.getBean("executor");
    }
View Full Code Here

TOP

Related Classes of org.springframework.context.ApplicationContext

Copyright © 2018 www.massapicom. 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.