Package org.apache.cocoon.environment

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


        } catch (SAXException sax) {
            throw new ProcessingException("SAXException: " + sax, sax);
        } catch (IOException ioe) {
            throw new ProcessingException("IOException: " + ioe, ioe);
        } finally {
            if (input != null) input.recycle();
            input = null;
        }

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END streamXMLFromFile");
View Full Code Here


        Source input = null;
        try {
            input = this.getSource(uri, typeParameters, resourceParameters);
            input.toSAX(filter);
        } finally {
            if (input != null) input.recycle();
            input = null;
        }

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END streamXMLFromURI");
View Full Code Here

                    }
                }
            } while (available > 0);
            content = buffer.toString();
        } finally {
            if (input != null) input.recycle();
            input = null;
        }

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END getContentFromURI content="+content);
View Full Code Here

            fis.close();
            content = (data == null ? "" : new String(data));
        } catch (FileNotFoundException local) {
            throw new ResourceNotFoundException("File not found '" + filename + "'", local);
        } finally {
            if (input != null) input.recycle();
            input = null;
        }
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END getContentFromFile content="+content);
        }
View Full Code Here

                } else {
                    this.resourceType = ResourceConnector.RESOURCE_TYPE_URI;
                    this.resourceIdentifier = identifier;
                }
            } finally {
                source.recycle();
            }
        } else {
            // check for relative cocoon:/ protocol
            if (identifier.startsWith("cocoon:/")
                && identifier.charAt("cocoon:/".length()) != '/') {
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

                    }
                } catch (Exception e) {
                    getLogger().error("Could not configure Database mapping environment", e);
                    throw new ConfigurationException("Error trying to load configurations for resource: " + (resource == null ? "null" : resource.getSystemId()));
                } finally {
                    if (resource != null) resource.recycle();
                    if (sourceHandler != null) this.manager.release((Component) sourceHandler);
                }
        } else {
        getLogger().debug("Using fixed cached configuration for " + descriptor);
        }
View Full Code Here

                getLogger().debug("currentCacheValidity: " + currentCacheValidity);
            } catch (Exception e) {
                getLogger().error("CachingCIncludeTransformer could not resolve resource:" + src,  e);
                throw new SAXException("CachingCIncludeTransformer could not resolve resource", e);
            } finally {
                if (temp != null) temp.recycle();
            }
        }

        if (!"".equals(element)) {
            AttributesImpl attrs = new AttributesImpl();
View Full Code Here

            source.toSAX(getConsumer());
        } catch (Exception e) {
            getLogger().error("CachingCIncludeTransformer", e);
            throw new SAXException("CachingCIncludeTransformer could not read resource", e);
        } finally {
            if (source != null) source.recycle();
        }

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

            throw e;
        } catch (Exception e) {
            getLogger().debug("Exception in JspGenerator.generate()", e);
            throw new ProcessingException("Exception JspGenerator.generate()",e);
        } finally {
            if (src != null) src.recycle();
            if (parser != null) this.manager.release(parser);
            if (engine != null) this.manager.release(engine);
        }
    }
}
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.