Package org.apache.cocoon

Examples of org.apache.cocoon.ConnectionResetException


                }
            } 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();
                        }
                        environment.setContentLength(baos.size());
                        baos.writeTo(os);
                    } 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);
                }
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

            }
        } 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 reader pipeline.", se);
            }
        } catch ( ProcessingException e ) {
            throw e;
View Full Code Here

                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("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) {
                    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

            }
        } 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 reader pipeline.", se);
            }
        } catch ( ProcessingException e ) {
            throw e;
View Full Code Here

        if (e instanceof SocketException) {
            if (e.getMessage().indexOf("reset") > -1
                    || e.getMessage().indexOf("aborted") > -1
                    || e.getMessage().indexOf("Broken pipe") > -1
                    || e.getMessage().indexOf("connection abort") > -1) {
                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 ConnectionResetException) {
            // Exception comes up from a deeper pipeline
            throw (ConnectionResetException)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("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) {
                    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

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.