Package org.springframework.beans.factory.xml

Examples of org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions()


      }

      // Load custom SQL error codes, overriding defaults.
      resource = loadResource(SQL_ERROR_CODE_OVERRIDE_PATH);
      if (resource != null && resource.exists()) {
        bdr.loadBeanDefinitions(resource);
        logger.info("Found custom sql-error-codes.xml file at the root of the classpath");
      }

      // Check all beans of type SQLErrorCodes.
      errorCodes = lbf.getBeansOfType(SQLErrorCodes.class, true, false);
View Full Code Here


      XmlBeanDefinitionReader bdr = new XmlBeanDefinitionReader(lbf);

      // Load default SQL error codes.
      Resource resource = loadResource(SQL_ERROR_CODE_DEFAULT_PATH);
      if (resource != null && resource.exists()) {
        bdr.loadBeanDefinitions(resource);
      }
      else {
        logger.warn("Default sql-error-codes.xml not found (should be included in spring.jar)");
      }
View Full Code Here

      }

      // Load custom SQL error codes, overriding defaults.
      resource = loadResource(SQL_ERROR_CODE_OVERRIDE_PATH);
      if (resource != null && resource.exists()) {
        bdr.loadBeanDefinitions(resource);
        logger.info("Found custom sql-error-codes.xml file at the root of the classpath");
      }

      // Check all beans of type SQLErrorCodes.
      errorCodes = lbf.getBeansOfType(SQLErrorCodes.class, true, false);
View Full Code Here

      Resource[] configResources = resourcePatternResolver.getResources(resourceLocation);
      if (configResources.length == 0) {
        throw new FatalBeanException("Unable to find resource for specified definition. " +
            "Group resource name [" + this.resourceLocation + "], factory key [" + factoryKey + "]");
      }
      reader.loadBeanDefinitions(configResources);
    }
    catch (IOException ex) {
      throw new BeanDefinitionStoreException(
          "Error accessing bean definition resource [" + this.resourceLocation + "]", ex);
    }
View Full Code Here

       
        // REVIEW: [rfeng] How do we control the schema validation
        xmlReader.setValidating(false);
       
        for (URL resource : resources) {
            xmlReader.loadBeanDefinitions(new UrlResource(resource));
        }
        xmlReader.setBeanClassLoader(implementation.getClassLoader());
        includeAnnotationProcessors(appCtx.getBeanFactory());
        return appCtx;
View Full Code Here

        // REVIEW: [rfeng] How do we control the schema validation
        xmlReader.setValidating(false);

        for (URL resource : resources) {
            xmlReader.loadBeanDefinitions(new UrlResource(resource));
        }

        return appCtx;

    }
View Full Code Here


  public void setUp() throws Exception {
    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory);
    reader.setEventListener(this.eventListener);
    reader.loadBeanDefinitions(new ClassPathResource("txNamespaceHandlerTests.xml", getClass()));
  }

  public void testComponentEventReceived() {
    ComponentDefinition component = this.eventListener.getComponentDefinition("txAdvice");
    assertTrue(component instanceof BeanComponentDefinition);
View Full Code Here

        // REVIEW: [rfeng] How do we control the schema validation
        xmlReader.setValidating(false);

        for (URL resource : resources) {
            xmlReader.loadBeanDefinitions(new UrlResource(resource));
        }
        xmlReader.setBeanClassLoader(implementation.getClassLoader());
        includeAnnotationProcessors(appCtx.getBeanFactory());
        return appCtx;
View Full Code Here

        // REVIEW: [rfeng] How do we control the schema validation
        xmlReader.setValidating(false);

        for (URL resource : resources) {
            xmlReader.loadBeanDefinitions(new UrlResource(resource));
        }

        return appCtx;

    }
View Full Code Here

  protected void setUp() throws Exception {
    this.beanFactory = new DefaultListableBeanFactory();
    this.beanFactory.registerScope("request", new RequestScope());
    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.beanFactory);
    reader.loadBeanDefinitions(new ClassPathResource("requestScopedProxyTests.xml", getClass()));
    this.beanFactory.preInstantiateSingletons();
  }

  public void testGetFromScope() throws Exception {
    String name = "requestScopedObject";
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.