Package org.apache.cocoon

Examples of org.apache.cocoon.ConnectionResetException


                this.reader.generate();
            }
        } catch ( SocketException se ) {
            if (se.getMessage().indexOf("reset") > 0
                || se.getMessage().indexOf("aborted") > 0) {
                throw new ConnectionResetException("Connection reset by peer", se);
            } else {
                throw new ProcessingException("Failed to execute reader pipeline.", se);
            }
        } catch ( ProcessingException e ) {
            throw e;
View Full Code Here


                    outputStream.write(this.cachedResponse);
                }
            } catch ( SocketException se ) {
                if (se.getMessage().indexOf("reset") > 0
                        || se.getMessage().indexOf("aborted") > 0) {
                    throw new ConnectionResetException("Connection reset by peer", se);
                } else {
                    throw new ProcessingException("Failed to execute reader pipeline.", se);
                }
            } catch ( Exception e ) {
                if (e instanceof ProcessingException)
                    throw (ProcessingException)e;
                throw new ProcessingException("Error executing reader pipeline.",e);
            }
        } else {

            if (this.getLogger().isDebugEnabled() && this.toCacheKey != null) {
                this.getLogger().debug("Caching content for further requests of '" + environment.getURI() + "' using key " + this.toCacheKey);
            }
            try {
                OutputStream os = null;
               
                if ( this.cacheCompleteResponse && this.toCacheKey != null) {
                    os = new CachingOutputStream( environment.getOutputStream(this.outputBufferSize) );
                }
                if ( super.serializer != super.lastConsumer ) {
                    if (os == null) {
                        os = environment.getOutputStream(this.outputBufferSize);
                    }
                    // internal processing
                    if ( this.xmlDeserializer != null ) {
                        this.xmlDeserializer.deserialize(this.cachedResponse);
                    } else {
                        this.generator.generate();
                    }
                } else {
                    if (this.serializer.shouldSetContentLength()) {
                        if (os == null) {
                            os = environment.getOutputStream(0);
                        }
                        // set the output stream
                        ByteArrayOutputStream baos = new ByteArrayOutputStream();
                        this.serializer.setOutputStream(baos);
   
                        // execute the pipeline:
                        if ( this.xmlDeserializer != null ) {
                            this.xmlDeserializer.deserialize(this.cachedResponse);
                        } else {
                            this.generator.generate();
                        }
                        byte[] data = baos.toByteArray();
                        environment.setContentLength(data.length);
                        os.write(data);
                    } else {
                        if (os == null) {
                            os = environment.getOutputStream(this.outputBufferSize);
                        }
                        // set the output stream
                        this.serializer.setOutputStream( os );
                        // execute the pipeline:
                        if ( this.xmlDeserializer != null ) {
                            this.xmlDeserializer.deserialize(this.cachedResponse);
                        } else {
                            this.generator.generate();
                        }
                    }
                }
                //
                // Now that we have processed the pipeline,
                // we do the actual caching
                //
                this.cacheResults(environment,os);

            } catch ( SocketException se ) {
                if (se.getMessage().indexOf("reset") > 0
                        || se.getMessage().indexOf("aborted") > 0) {
                    throw new ConnectionResetException("Connection reset by peer", se);
                } else {
                    throw new ProcessingException("Failed to execute reader pipeline.", se);
                }
            } catch ( ProcessingException e ) {
                throw e;
View Full Code Here

                }
            }
        } catch ( SocketException se ) {
            if (se.getMessage().indexOf("reset") > 0
                    || se.getMessage().indexOf("aborted") > 0) {
                throw new ConnectionResetException("Connection reset by peer", se);
            } else {
                throw new ProcessingException("Failed to execute pipeline.", se);
            }
        } catch ( ProcessingException e ) {
            throw e;
View Full Code Here

                              ((CachingOutputStream)outputStream).getContent()));
                }
            }
        } catch ( SocketException se ) {
            if (se.getMessage().indexOf("reset") > 0) {
                throw new ConnectionResetException("Connection reset by peer", se);
            } else {
                getLogger().debug("IOException in ProcessReader", se);

                throw new ProcessingException(
                    "Failed to execute pipeline.",
View Full Code Here

                }
            }
        } catch ( SocketException se ) {
            if (se.getMessage().indexOf("reset") > 0
                || se.getMessage().indexOf("aborted") > 0) {
                throw new ConnectionResetException("Connection reset by peer", se);
            } else {
                getLogger().debug("SocketException in ProcessReader", se);

                throw new ProcessingException(
                    "Failed to execute pipeline.",
View Full Code Here

                }
            } catch ( SocketException se ) {
                if (se.getMessage().indexOf("reset") > 0
                        || se.getMessage().indexOf("aborted") > 0
                        || se.getMessage().indexOf("connection abort") > 0) {
                    throw new ConnectionResetException("Connection reset by peer", se);
                } else {
                    throw new ProcessingException("Failed to execute pipeline.", se);
                }
            } catch ( Exception e ) {
                if (e instanceof ProcessingException)
                    throw (ProcessingException)e;
                throw new ProcessingException("Error executing pipeline.",e);
            }
        } else {

            if (this.getLogger().isDebugEnabled() && this.toCacheKey != null) {
                this.getLogger().debug("processXMLPipeline: caching content for further requests of '" + environment.getURI() + "' using key " + this.toCacheKey);
            }
            try {
                OutputStream os = null;
               
                if ( this.cacheCompleteResponse && this.toCacheKey != null) {
                    os = new CachingOutputStream( environment.getOutputStream(this.outputBufferSize) );
                }
                if ( super.serializer != super.lastConsumer ) {
                    if (os == null) {
                        os = environment.getOutputStream(this.outputBufferSize);
                    }
                    // internal processing
                    if ( this.xmlDeserializer != null ) {
                        this.xmlDeserializer.deserialize(this.cachedResponse);
                    } else {
                        this.generator.generate();
                    }
                } else {
                    if (this.serializer.shouldSetContentLength()) {
                        if (os == null) {
                            os = environment.getOutputStream(0);
                        }
                        // set the output stream
                        ByteArrayOutputStream baos = new ByteArrayOutputStream();
                        this.serializer.setOutputStream(baos);
   
                        // execute the pipeline:
                        if ( this.xmlDeserializer != null ) {
                            this.xmlDeserializer.deserialize(this.cachedResponse);
                        } else {
                            this.generator.generate();
                        }
                        byte[] data = baos.toByteArray();
                        environment.setContentLength(data.length);
                        os.write(data);
                    } else {
                        if (os == null) {
                            os = environment.getOutputStream(this.outputBufferSize);
                        }
                        // set the output stream
                        this.serializer.setOutputStream( os );
                        // execute the pipeline:
                        if ( this.xmlDeserializer != null ) {
                            this.xmlDeserializer.deserialize(this.cachedResponse);
                        } else {
                            this.generator.generate();
                        }
                    }
                }
                //
                // Now that we have processed the pipeline,
                // we do the actual caching
                //
                this.cacheResults(environment,os);

            } catch ( SocketException se ) {
                if (se.getMessage().indexOf("reset") > 0
                        || se.getMessage().indexOf("aborted") > 0
                        || se.getMessage().indexOf("connection abort") > 0) {
                    throw new ConnectionResetException("Connection reset by peer", se);
                } else {
                    throw new ProcessingException("Failed to execute pipeline.", se);
                }
            } catch ( ProcessingException e ) {
                throw e;
View Full Code Here

            }
        } catch ( SocketException se ) {
            if (se.getMessage().indexOf("reset") > 0
                    || se.getMessage().indexOf("aborted") > 0
                    || se.getMessage().indexOf("connection abort") > 0) {
                throw new ConnectionResetException("Connection reset by peer", se);
            } else {
                throw new ProcessingException("Failed to execute pipeline.", se);
            }
        } catch ( ProcessingException e ) {
            throw e;
View Full Code Here

    protected void handleException(Exception e) throws ProcessingException {
        if (e instanceof SocketException) {
            if (e.getMessage().indexOf("reset") > 0
                    || e.getMessage().indexOf("aborted") > 0
                    || e.getMessage().indexOf("connection abort") > 0) {
                throw new ConnectionResetException("Connection reset by peer", e);
            }
        } else if (e instanceof IOException) {
            // Tomcat5 wraps SocketException into ClientAbortException which extends IOException.
            if (e.getClass().getName().endsWith("ClientAbortException")) {
                throw new ConnectionResetException("Connection reset by peer", e);
            }
        } else if (e instanceof ProcessingException) {
            throw (ProcessingException) e;
        }
View Full Code Here

            }
        } catch ( SocketException se ) {
            if (se.getMessage().indexOf("reset") > 0
                    || se.getMessage().indexOf("aborted") > 0
                    || se.getMessage().indexOf("connection abort") > 0) {
                throw new ConnectionResetException("Connection reset by peer", se);
            } else {
                throw new ProcessingException("Failed to execute pipeline.", se);
            }
        } catch ( ProcessingException pe ) {
            throw pe;
View Full Code Here

            }
        } catch ( SocketException se ) {
            if (se.getMessage().indexOf("reset") > 0
                    || se.getMessage().indexOf("aborted") > 0
                    || se.getMessage().indexOf("connection abort") > 0) {
                throw new ConnectionResetException("Connection reset by peer", se);
            } else {
                throw new ProcessingException("Failed to execute pipeline.", se);
            }
        } catch ( ProcessingException pe ) {
            throw pe;
View Full Code Here

TOP

Related Classes of org.apache.cocoon.ConnectionResetException

Copyright © 2018 www.massapicom. 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.