Package org.apache.cocoon.environment

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


            } catch (SAXException se) {
                throw new IOException("SAXException: " + se);
            } catch (ProcessingException pe) {
                throw new IOException("ProcessingException: " + pe);
            } finally {
                if (redirectSource != null) redirectSource.recycle();
            }
        }
    }
   
    public boolean hasRedirected() {
View Full Code Here


                } finally {
                    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

                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

                    stream.close();
                } catch (Exception ase) {
                    throw new CascadingRuntimeException("Failed to close stream", ase);
                }
            if ( resource != null )
                resource.recycle();
        }
        return result.toString();
    }

View Full Code Here

            source.toSAX(new org.apache.cocoon.xml.IncludeXMLConsumer(contentHandler));
          } catch (Exception e) {
              throw new CascadingRuntimeException("Error including source "+base+" "+uri, e);
          } finally {
              if (source != null)
                 source.recycle();
          }
    }
   
    public static void includeString(String string, ComponentManager manager, ContentHandler contentHandler)
        throws RuntimeException {
View Full Code Here

                    this.logfile = new FileWriter(systemId.substring(5), append );
                } else {
                    throw new ProcessingException("The logfile parameter must point to a file: " + logfilename);
                }
            } finally {
                if (source != null) source.recycle();
            }
        }

        Date date = new Date();
        StringBuffer logEntry = new StringBuffer();
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

                        timeStamp == 0)
                        return false;
                } catch (Exception e) {
                    return false;
                } finally {
                    if (otherSource != null) otherSource.recycle();
                }
            }
            return true;
        }
        return false;
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.