/** ******** LogChute methods ************ */
  public void init(RuntimeServices rs) {
    String name = (String) rs.getProperty(LOGCHUTE_COMMONS_LOG_NAME);

    if (name == null) {
      name = DEFAULT_LOG_NAME;
    }
    log = LogFactory.getLog(name);
    log(LogChute.DEBUG_ID, "CommonsLogLogChute name is '" + name + "'");
  }
예제 #2
0
  @Override
  public void init(RuntimeServices rs, InternalContextAdapter context, Node node)
      throws TemplateInitException {
    super.init(rs, context, node);

    // 获取缓存提供者
    Object _cache = rs.getProperty(CACHE_PROVIDER);
    if (_cache != null && _cache instanceof Cache) {
      cache = (MemcachedClient) _cache;
    } else {
      throw new TemplateInitException(
          CACHE_PROVIDER
              + " Cannot find the direcitive.cache.provider, or the direcitive.cache.provider object is incorrect.",
          "cache",
          0,
          0);
    }

    // 获取缓存提供者
    Object _time = rs.getProperty(CACHE_TIME);
    if (_time != null) {
      time = Long.valueOf(_time.toString());
    }
  }
 @Override
 public void commonInit(RuntimeServices rs, ExtendedProperties configuration) {
   super.commonInit(rs, configuration);
   this.templateEngine = (ITemplateEngine) rs.getProperty(VELOCITY_TEMPLATE_ENGINE_KEY);
 }