Exemplo n.º 1
0
 public Serializable getKey() {
   JXTExpression cacheKeyExpr =
       (JXTExpression) this.startDocument.getTemplateProperty(JXTemplateGenerator.CACHE_KEY);
   if (cacheKeyExpr == null) return null;
   try {
     final Serializable templateKey = (Serializable) cacheKeyExpr.getValue(this.expressionContext);
     if (templateKey != null) {
       return new JXCacheKey(this.startDocument.getUri(), templateKey);
     }
   } catch (Exception e) {
     getLogger().error("error evaluating cache key", e);
   }
   return null;
 }
Exemplo n.º 2
0
 public SourceValidity getValidity() {
   JXTExpression validityExpr =
       (JXTExpression) this.startDocument.getTemplateProperty(JXTemplateGenerator.VALIDITY);
   if (validityExpr == null) return null;
   try {
     final SourceValidity sourceValidity = this.startDocument.getSourceValidity();
     final SourceValidity templateValidity =
         (SourceValidity) validityExpr.getValue(this.expressionContext);
     if (sourceValidity != null && templateValidity != null) {
       return new JXSourceValidity(sourceValidity, templateValidity);
     }
   } catch (Exception e) {
     getLogger().error("error evaluating cache validity", e);
   }
   return null;
 }