cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject [c2] timeout parameter to FileGenerator
Date Tue, 15 May 2001 17:16:49 GMT
so i was taking a look at implementing this and noticed something. it
would appear that the first access of an external resources will result in
two HTTP requests. the setup method is:

    public void setup(EntityResolver resolver, Map objectModel, String
src, Parameters par)
        throws ProcessingException, SAXException, IOException {
        super.setup(resolver, objectModel, src, par);
        this.inputSource = super.resolver.resolveEntity(null,
super.source);
        this.systemID = this.inputSource.getSystemId();
        if (this.systemID.startsWith(FILE) == true) {
            File xmlFile = new
File(this.systemID.substring(FILE.length()));
            this.lastModificationDate = xmlFile.lastModified();
        } else {
            try {
                java.net.URL u= new java.net.URL(this.systemID);
                java.net.URLConnection conn = u.openConnection();
                this.lastModificationDate =
u.openConnection().getLastModified();
            } catch (java.net.MalformedURLException local) {
                // we ignore this at this stage
                this.lastModificationDate = 0; // no caching!
            }
        }
    }

which involves one url connection being fired off, and then in the
generate method, the parser will fire off another connection:

            parser.parse(this.inputSource);

hmm. that's not so good. is this an accurate assessment?

- donald


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message