Package org.apache.cocoon.environment

Examples of org.apache.cocoon.environment.Source.recycle()


            src.getInputStream();
        } catch (Exception e) {
            getLogger().debug("ResourceExistsAction: exception: ",e);
            return null;
        } finally {
            if (src != null) src.recycle();
        }
        return EMPTY_MAP;
    }

}
View Full Code Here


        } catch (IOException ioe) {
            getLogger().warn("Could not read directory " + directory, ioe);
            throw new ResourceNotFoundException("Could not read directory "
                + directory, ioe);
        } finally {
            if (inputSource != null) inputSource.recycle();
        }
    }

    /**
     * Creates a stack containing the ancestors of File up to specified
View Full Code Here

            throw e;
        } catch (Exception e) {
            throw new ProcessingException(
                    "Exception in ScriptAction.act()", e);
        } finally {
            if (src != null) src.recycle();
        } // try/catch
    } // public Map act(...)
} // public class ScriptAction
View Full Code Here

            throw e;
        } catch (Exception e) {
            getLogger().debug("PhpGenerator.generate()", e);
            throw new IOException(e.toString());
        } finally {
            if (inputSource != null) inputSource.recycle();
            if (parser != null) this.manager.release(parser);
        }
    }
}
View Full Code Here

            throw new SAXException("CIncludeTransformer could not read resource", e);
        } catch (ProcessingException e){
            getLogger().error("Could not stream input", e);
            throw new SAXException("Exception in CIncludeTransformer",e);
        } finally {
            source.recycle();
        }

        if (!"".equals(element)) {
            super.endElement(ns, element, (!ns.equals("") && !prefix.equals("") ? prefix+":"+element : element));
            if (!ns.equals("")) {
View Full Code Here

                } finally {
                    if(parser != null) this.manager.release(parser);
                }
            }
        } finally {
            if (url != null) url.recycle();
        }
    }

    public void recycle()
    {
View Full Code Here

            try {
                InputSource xslsrc = source.getInputSource();
                loaderprocessor.loadStylesheet(xslsrc);
                if (store != null) store.store(xsluri, loaderprocessor);
            } finally {
                source.recycle();
            }
        }

        // Always clone the processor before using it,
        // Indeed 1 instance per thread is allowed
View Full Code Here

            systemId = fileSource.getSystemId();
            if (systemId.startsWith("file:") == false) {
                throw new ProcessingException("insertFragment: this is not a file: " + systemId);
            }
        } finally {
            if (fileSource != null) fileSource.recycle();
        }
        if (path.startsWith("/") == true) path = path.substring(1);

        File file = new File(systemId.substring(5));
        DocumentFragment resource = null;
View Full Code Here

    public void recycle() {
        super.recycle();
        this.rootElement = null;
        for (Iterator i = this.parts.iterator(); i.hasNext();) {
            final Source source = ((Part)i.next()).source;
            if ( null != source) source.recycle();
        }
        this.parts.clear();
        this.currentElement = null;
    }
View Full Code Here

            Source contextSource = null;
            try {
                contextSource = environment.resolve("");
                contextFileName = contextSource.getSystemId();
            } finally {
                if (contextSource != null) contextSource.recycle();
            }
        } finally {
            environment.setSourceHandler(oldSourceHandler);
        }
        if (!this.isRegenerationRunning) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.