FileDocCategorySizeDatePackage
DigestedValue.javaAPI DocExample1202Wed Aug 25 22:44:38 BST 2004com.oreilly.strutsckbk.ch10

DigestedValue

public class DigestedValue extends Object implements Refreshable

Fields Summary
private static Log
log
private Object
value
private URL
sourceUrl
private URL
rulesUrl
Constructors Summary
public DigestedValue(Object value, URL sourceUrl, URL rulesUrl)


           
        this.sourceUrl = sourceUrl;
        this.rulesUrl = rulesUrl;
        this.value = value;
    
Methods Summary
public java.lang.ObjectgetValue()

        return value;
    
public synchronized voidrefresh()

        Digester digester = DigesterLoader.createDigester(rulesUrl);
        try {
            Object val = digester.parse(sourceUrl.openStream());
            if (val != null) 
                value = val;
            else
                log.error("Returned value was null due to unknown error");
        } catch (Exception e) {
            log.error("Unable to redigest value.", e);
        }