/** 初始化resource loader. */ @Override public void init(ExtendedProperties configuration) { rsvc.getLog().info(getLogID() + " : initialization starting."); preloadedResources = createTreeMap(); @SuppressWarnings("unchecked") Map<String, Resource> resources = assertNotNull( (Map<String, Resource>) configuration.getProperty(PRELOADED_RESOURCES_KEY), PRELOADED_RESOURCES_KEY); for (Map.Entry<String, Resource> entry : resources.entrySet()) { String templateName = normalizeTemplateName(entry.getKey()); Resource resource = entry.getValue(); preloadedResources.put(templateName, resource); } rsvc.getLog().info(getLogID() + " : preloaded resources: " + new MapBuilder().appendAll(preloadedResources)); rsvc.getLog().info(getLogID() + " : initialization complete."); }
/** 初始化resource loader. */ @Override public void init(ExtendedProperties configuration) { rsvc.getLog().info(getLogID() + " : initialization starting."); preloadedResources = createTreeMap(); @SuppressWarnings("unchecked") Map<String, Resource> resources = assertNotNull( (Map<String, Resource>) configuration.getProperty(PRELOADED_RESOURCES_KEY), PRELOADED_RESOURCES_KEY); for (Map.Entry<String, Resource> entry : resources.entrySet()) { String templateName = normalizeTemplateName(entry.getKey()); Resource resource = entry.getValue(); preloadedResources.put(templateName, resource); } rsvc.getLog().info(getLogID() + " : preloaded resources: " + new MapBuilder().appendAll(preloadedResources)); rsvc.getLog().info(getLogID() + " : initialization complete."); }
/** 初始化resource loader. */ @Override public void init(ExtendedProperties configuration) { rsvc.getLog().info(getLogID() + " : initialization starting."); springLoader = assertNotNull((ResourceLoader) rsvc.getApplicationAttribute(SPRING_RESOURCE_LOADER_KEY), SPRING_RESOURCE_LOADER_KEY); path = normalizeAbsolutePath(configuration.getString("path"), true); assertTrue(!isEmpty(path), "path"); path += "/"; rsvc.getLog().info(getLogID() + " : set path '" + path + "'"); rsvc.getLog().info(getLogID() + " : initialization complete."); }
/** 初始化resource loader. */ @Override public void init(ExtendedProperties configuration) { rsvc.getLog().info(getLogID() + " : initialization starting."); springLoader = assertNotNull((ResourceLoader) rsvc.getApplicationAttribute(SPRING_RESOURCE_LOADER_KEY), SPRING_RESOURCE_LOADER_KEY); path = normalizeAbsolutePath(configuration.getString("path"), true); assertTrue(!isEmpty(path), "path"); path += "/"; rsvc.getLog().info(getLogID() + " : set path '" + path + "'"); rsvc.getLog().info(getLogID() + " : initialization complete."); }
public void setRuntimeServices(RuntimeServices rs) { log = rs.getLog("rendering"); } }
/** * @param rs */ public void setRuntimeServices( RuntimeServices rs ) { rsvc = rs; log = rsvc.getLog("loader"); }
protected Logger getLog() { return rsvc == null ? LoggerFactory.getLogger(EventCartridge.class) : rsvc.getLog(); }
@Override public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException { log = rs.getLog(); super.init(rs, context, node); } }
/** * @see org.apache.velocity.util.RuntimeServicesAware#setRuntimeServices(org.apache.velocity.runtime.RuntimeServices) */ public void setRuntimeServices(RuntimeServices rs) { this.rs = rs; log = rs.getLog("event"); notfound = StringUtils.trim(rs.getString(PROPERTY_NOT_FOUND, DEFAULT_NOT_FOUND)); }
@Override public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException { log = rs.getLog(); super.init(rs, context, node); }
@Override public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException { super.init(rs, context, node); log = rs.getLog(); //set compressor properties enabled = rs.getBoolean("userdirective.compressCss.enabled", true); yuiCssLineBreak = rs.getInt("userdirective.compressCss.yuiCssLineBreak", -1); }
@Override public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException { super.init(rs, context, node); log = rs.getLog(); // set compressor properties enabled = rs.getBoolean("userdirective.compressCss.enabled", true); yuiCssLineBreak = rs.getInt("userdirective.compressCss.yuiCssLineBreak", -1); }
/** * Initialize members of VelocimacroProxy. called from MacroEntry */ public void init(RuntimeServices rs) { rsvc = rs; log = rs.getLog("macro"); strictArguments = rsvc.getBoolean( RuntimeConstants.VM_ARGUMENTS_STRICT, false); // get the macro call depth limit maxCallDepth = rsvc.getInt(RuntimeConstants.VM_MAX_DEPTH); // get name of the reference that refers to AST block passed to block macro call bodyReference = rsvc.getString(RuntimeConstants.VM_BODY_REFERENCE, "bodyContent"); }
/** * simple init - get the key */ public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException { super.init(rs, context, node); log = rsvc.getLog(); /** * No checking is done. We just grab the last child node and assume * that it's the block! */ block = node.jjtGetChild(node.jjtGetNumChildren() - 1); }
/** 初始化resource loader. */ @Override public void init(ExtendedProperties configuration) { rsvc.getLog().info(getLogID() + " : initialization starting."); springLoader = assertNotNull((ResourceLoader) rsvc.getApplicationAttribute(SPRING_RESOURCE_LOADER_KEY), SPRING_RESOURCE_LOADER_KEY); path = normalizeAbsolutePath(configuration.getString("path"), true); assertTrue(!isEmpty(path), "path"); path += "/"; rsvc.getLog().info(getLogID() + " : set path '" + path + "'"); rsvc.getLog().info(getLogID() + " : initialization complete."); }
public void initialize(RuntimeServices rsvc) { config = new GenericObjectPool.Config(); config.maxActive = rsvc.getInt(Props.MAX_ACTIVE, Props.MAX_ACTIVE_DEFAULT); config.maxIdle = rsvc.getInt(Props.MAX_IDLE, Props.MAX_IDLE_DEFAULT); config.maxWait = rsvc.getInt(Props.MAX_WAIT, Props.MAX_WAIT_DEFAULT); config.timeBetweenEvictionRunsMillis = -1; // -1 to disable evictor thread. pool = new GenericObjectPool(new ParserFactory(rsvc), config); if (rsvc.getLog().isDebugEnabled()) { rsvc.getLog().debug("Created parser pool: " + this); } }
@Override public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException { super.init(rs, context, node); log = rs.getLog(); //set compressor properties enabled = rs.getBoolean("userdirective.compressJs.enabled", true); jsCompressor = rs.getString("userdirective.compressHtml.jsCompressor", HtmlCompressor.JS_COMPRESSOR_YUI); yuiJsNoMunge = rs.getBoolean("userdirective.compressJs.yuiJsNoMunge", false); yuiJsPreserveAllSemiColons = rs.getBoolean("userdirective.compressJs.yuiJsPreserveAllSemiColons", false); yuiJsLineBreak = rs.getInt("userdirective.compressJs.yuiJsLineBreak", -1); closureOptLevel = rs.getString("userdirective.compressHtml.closureOptLevel", ClosureJavaScriptCompressor.COMPILATION_LEVEL_SIMPLE); }
@Override public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException { super.init(rs, context, node); log = rs.getLog(); //set compressor properties xmlCompressor.setEnabled(rs.getBoolean("userdirective.compressXml.enabled", true)); xmlCompressor.setRemoveComments(rs.getBoolean("userdirective.compressXml.removeComments", true)); xmlCompressor.setRemoveIntertagSpaces(rs.getBoolean("userdirective.compressXml.removeIntertagSpaces", true)); }
@Override public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException { super.init(rs, context, node); log = rs.getLog(); // set compressor properties xmlCompressor.setEnabled(rs.getBoolean("userdirective.compressXml.enabled", true)); xmlCompressor.setRemoveComments(rs.getBoolean("userdirective.compressXml.removeComments", true)); xmlCompressor.setRemoveIntertagSpaces(rs.getBoolean("userdirective.compressXml.removeIntertagSpaces", true)); }
@Override public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException { super.init(rs, context, node); log = rs.getLog(); // set compressor properties enabled = rs.getBoolean("userdirective.compressJs.enabled", true); jsCompressor = rs.getString("userdirective.compressHtml.jsCompressor", HtmlCompressor.JS_COMPRESSOR_YUI); yuiJsNoMunge = rs.getBoolean("userdirective.compressJs.yuiJsNoMunge", false); yuiJsPreserveAllSemiColons = rs.getBoolean("userdirective.compressJs.yuiJsPreserveAllSemiColons", false); yuiJsLineBreak = rs.getInt("userdirective.compressJs.yuiJsLineBreak", -1); closureOptLevel = rs.getString("userdirective.compressHtml.closureOptLevel", ClosureJavaScriptCompressor.COMPILATION_LEVEL_SIMPLE); }