Package org.springframework.core.io

Examples of org.springframework.core.io.InputStreamResource


   
    private XmlBeanFactory getBeanFactory(ServletContext servletContext) {
        if (beanFactory == null) {
            InputStream is = servletContext.getResourceAsStream(
                DRIVER_CONFIG_FILE);
            beanFactory = new XmlBeanFactory(new InputStreamResource(
                is, "Driver Configuration"));
        }
        return beanFactory;
    }
View Full Code Here


    private synchronized void buildAppContext(MessageContext synCtx) {
        log.debug("Creating Spring ApplicationContext from property key : " + configKey);
        GenericApplicationContext appContext = new GenericApplicationContext();
        XmlBeanDefinitionReader xbdr = new XmlBeanDefinitionReader(appContext);
        xbdr.setValidating(false);
        xbdr.loadBeanDefinitions(new InputStreamResource(
            Util.getStreamSource(
                    synCtx.getConfiguration().getProperty(configKey)).getInputStream()));
        appContext.refresh();
        this.appContext = appContext;
    }
View Full Code Here

    processEngineConfiguration.setBeans(new SpringBeanFactoryProxyMap(beanFactory));
    return processEngineConfiguration;
  }

  public static ProcessEngineConfiguration parseProcessEngineConfigurationFromInputStream(InputStream inputStream, String beanName) {
    Resource springResource = new InputStreamResource(inputStream);
    return parseProcessEngineConfiguration(springResource, beanName);
  }
View Full Code Here

        return super.createPlatform();
    }

    @Override
    protected Resource getTestingFrameworkBundlesConfiguration() {
        return new InputStreamResource( AbstractDroolsSpringDMTest.class.getResourceAsStream( TEST_FRAMEWORK_BUNDLES_CONF_FILE ) );
    }
View Full Code Here

        return super.createPlatform();
    }

    @Override
    protected Resource getTestingFrameworkBundlesConfiguration() {
        return new InputStreamResource( AbstractDroolsSpringDMTest.class.getResourceAsStream( TEST_FRAMEWORK_BUNDLES_CONF_FILE ) );
    }
View Full Code Here

                            + "-application-context.xml");
                }
                // load the context file from meta-inf
                if (ctxFileInputStream != null) {
                    xbdr.setValidationMode(XmlBeanDefinitionReader.VALIDATION_NONE);
                    xbdr.loadBeanDefinitions(new InputStreamResource(ctxFileInputStream));
                    appContext.refresh();
                    axisService.addParameter(new Parameter(SPRING_APPLICATION_CONTEXT, appContext));
                    return appContext;
                } else {
                    throw new AxisFault("Spring context file cannot be located for AxisService");
View Full Code Here

            LOG.log(Level.INFO, "BUILD_ENDPOINTS_FROM_CONFIG_LOCATION", new Object[]{location});
            childCtx = new GenericApplicationContext(ctx);
           
            XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(childCtx);
            reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
            reader.loadBeanDefinitions(new InputStreamResource(is, location));
           
            childCtx.refresh();
        }
    }
View Full Code Here

  }

  public void testWithOpenInputStream() {
    try {
      SimpleBeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();;
      Resource resource = new InputStreamResource(getClass().getResourceAsStream("test.xml"));
      new XmlBeanDefinitionReader(registry).loadBeanDefinitions(resource);
      fail("Should have thrown BeanDefinitionStoreException (can't determine validation mode)");
    }
    catch (BeanDefinitionStoreException expected) {
    }
View Full Code Here

    }
  }

  public void testWithOpenInputStreamAndExplicitValidationMode() {
    SimpleBeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();;
    Resource resource = new InputStreamResource(getClass().getResourceAsStream("test.xml"));
    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(registry);
    reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_DTD);
    reader.loadBeanDefinitions(resource);
    testBeanDefinitions(registry);
  }
View Full Code Here

            LOG.log(Level.INFO, "BUILD_ENDPOINTS_FROM_CONFIG_LOCATION", new Object[]{location});
            childCtx = new GenericApplicationContext(ctx);
           
            XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(childCtx);
            reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
            reader.loadBeanDefinitions(new InputStreamResource(is, location));
           
            childCtx.refresh();
        }
    }
View Full Code Here

TOP

Related Classes of org.springframework.core.io.InputStreamResource

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.