/** * Configures a bean from an XML input stream. */ public static Configuration parseConfiguration(final InputStream inputStream) throws CacheException { LOG.debug("Configuring ehcache from InputStream"); Configuration configuration = new Configuration(); try { InputStream translatedInputStream = translateSystemProperties(inputStream); final SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); final BeanHandler handler = new BeanHandler(configuration); parser.parse(translatedInputStream, handler); } catch (Exception e) { throw new CacheException("Error configuring from input stream. Initial cause was " + e.getMessage(), e); } configuration.setSource(ConfigurationSource.getConfigurationSource(inputStream)); return configuration; }
/** * Configures a bean from an XML input stream. */ public static Configuration parseConfiguration(final InputStream inputStream) throws CacheException { LOG.debug("Configuring ehcache from InputStream"); Configuration configuration = new Configuration(); try { InputStream translatedInputStream = translateSystemProperties(inputStream); final SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); final BeanHandler handler = new BeanHandler(configuration); parser.parse(translatedInputStream, handler); } catch (Exception e) { throw new CacheException("Error configuring from input stream. Initial cause was " + e.getMessage(), e); } configuration.setSource(ConfigurationSource.getConfigurationSource(inputStream)); return configuration; }
/** * Configures a bean from an XML input stream. */ public static Configuration parseConfiguration(final InputStream inputStream) throws CacheException { LOG.debug("Configuring ehcache from InputStream"); Configuration configuration = new Configuration(); try { InputStream translatedInputStream = translateSystemProperties(inputStream); final SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); final BeanHandler handler = new BeanHandler(configuration); parser.parse(translatedInputStream, handler); } catch (Exception e) { throw new CacheException("Error configuring from input stream. Initial cause was " + e.getMessage(), e); } configuration.setSource(ConfigurationSource.getConfigurationSource(inputStream)); return configuration; }
/** * Configures a bean from an XML input stream. */ public static Configuration parseConfiguration(final InputStream inputStream) throws CacheException { LOG.debug("Configuring ehcache from InputStream"); Configuration configuration = new Configuration(); try { InputStream translatedInputStream = translateSystemProperties(inputStream); final SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); final BeanHandler handler = new BeanHandler(configuration); parser.parse(translatedInputStream, handler); } catch (Exception e) { throw new CacheException("Error configuring from input stream. Initial cause was " + e.getMessage(), e); } configuration.setSource(ConfigurationSource.getConfigurationSource(inputStream)); return configuration; }