Examples of XMLTeePipe


Examples of org.apache.cocoon.components.sax.XMLTeePipe

                    Iterator itt = this.transformers.iterator();
                    while ( itt.hasNext() ) {
                        next = (XMLConsumer) itt.next();
                        if (localXMLSerializer != null) {
                            if (cacheableTransformerCount == 0) {
                                next = new XMLTeePipe(next, localXMLSerializer);
                                localXMLSerializer = null;
                            } else {
                                cacheableTransformerCount--;
                            }
                        }
                        this.connect(environment, prev, next);
                        prev = (XMLProducer) next;
                    }
                    next = super.lastConsumer;
                    if (localXMLSerializer != null) {
                        next = new XMLTeePipe(next, localXMLSerializer);
                        localXMLSerializer = null;
                    }
                    this.connect(environment, prev, next);
                } else {
                    this.xmlDeserializer = (XMLDeserializer)this.manager.lookup(XMLDeserializer.ROLE);
                    // connect the pipeline:
                    XMLProducer prev = xmlDeserializer;
                    XMLConsumer next;
                    int cacheableTransformerCount = 0;
                    Iterator itt = this.transformers.iterator();
                    while ( itt.hasNext() ) {
                        next = (XMLConsumer) itt.next();
                        if (cacheableTransformerCount >= this.firstProcessedTransformerIndex) {
                            if (localXMLSerializer != null
                                    && cacheableTransformerCount == this.firstNotCacheableTransformerIndex) {
                                next = new XMLTeePipe(next, localXMLSerializer);
                                localXMLSerializer = null;
                            }
                            this.connect(environment, prev, next);
                            prev = (XMLProducer)next;
                        }
                        cacheableTransformerCount++;
                    }
                    next = super.lastConsumer;
                    if (localXMLSerializer != null) {
                        next = new XMLTeePipe(next, localXMLSerializer);
                        localXMLSerializer = null;
                    }
                    this.connect(environment, prev, next);
                }
View Full Code Here

Examples of org.apache.cocoon.components.sax.XMLTeePipe

                            if ( (this.isCachePoint.get(currentTransformerIndex) != null&&
                                    ((Boolean)this.isCachePoint.get(currentTransformerIndex)).booleanValue()) {

                                cachePointXMLSerializer = ((XMLSerializer)
                                this.manager.lookup( XMLSerializer.ROLE ));
                                next = new XMLTeePipe(next, cachePointXMLSerializer);
                                this.xmlSerializerArray.add(cachePointXMLSerializer);
                            }
                        }


                // Serializer is not cacheable,
            // but we  have the longest cacheable key. Do default longest key caching
                        if (localXMLSerializer != null) {
                            if (cacheableTransformerCount == 0) {
                                next = new XMLTeePipe(next, localXMLSerializer);
                                this.xmlSerializerArray.add(localXMLSerializer);
                                localXMLSerializer = null;
                            } else {
                                cacheableTransformerCount--;
                            }
                        }
                        this.connect(environment, prev, next);
                        prev = (XMLProducer) next;

                        currentTransformerIndex++;
                    }
                    next = super.lastConsumer;


            // if the serializer is not cacheable, but all the transformers are:
            // (this is default longest key caching)
                    if (localXMLSerializer != null) {
                        next = new XMLTeePipe(next, localXMLSerializer);
                        this.xmlSerializerArray.add(localXMLSerializer);
                        localXMLSerializer = null;
                    }

            // else if the serializer is cacheable and has cocoon views
                    else if ((currentTransformerIndex == this.firstNotCacheableTransformerIndex) &&
                            this.nextIsCachePoint) {
                        cachePointXMLSerializer = ((XMLSerializer)this.manager.lookup( XMLSerializer.ROLE ));
                        next = new XMLTeePipe(next, cachePointXMLSerializer);
                        this.xmlSerializerArray.add(cachePointXMLSerializer);
                    }
                    this.connect(environment, prev, next);


                } else {
                    // Here the first part of the pipeline has been retrived from cache
                    // we now check if any part of the rest of the pipeline can be cached
                    this.xmlDeserializer = (XMLDeserializer)this.manager.lookup(XMLDeserializer.ROLE);
                    // connect the pipeline:
                    XMLProducer prev = xmlDeserializer;
                    XMLConsumer next;
                    int cacheableTransformerCount = 0;
                    Iterator itt = this.transformers.iterator();
                    while ( itt.hasNext() ) {
                        next = (XMLConsumer) itt.next();

                        if (cacheableTransformerCount >= this.firstProcessedTransformerIndex) {

                // if we have cacheable transformers left,
                // then check the tranformers for cachepoints
                            if (cacheableTransformerCount < this.firstNotCacheableTransformerIndex) {
                                if ( !(prev instanceof XMLDeserializer) &&
                                        (this.isCachePoint.get(cacheableTransformerCount) != null&&
                                        ((Boolean)this.isCachePoint.get(cacheableTransformerCount)).booleanValue()) {
                                    cachePointXMLSerializer = ((XMLSerializer)this.manager.lookup( XMLSerializer.ROLE ));
                                    next = new XMLTeePipe(next, cachePointXMLSerializer);
                                    this.xmlSerializerArray.add(cachePointXMLSerializer);
                                }
                            }

                    // Serializer is not cacheable,
                // but we  have the longest cacheable key. Do default longest key caching
                            if (localXMLSerializer != null && !(prev instanceof XMLDeserializer)
                                    && cacheableTransformerCount == this.firstNotCacheableTransformerIndex) {
                                next = new XMLTeePipe(next, localXMLSerializer);
                                this.xmlSerializerArray.add(localXMLSerializer);
                                localXMLSerializer = null;
                            }
                            this.connect(environment, prev, next);
                            prev = (XMLProducer)next;
                        }
                        cacheableTransformerCount++;
                    }
                    next = super.lastConsumer;

            //*all* the transformers are cacheable, but the serializer is not!! this is longest key
                    if (localXMLSerializer != null && !(prev instanceof XMLDeserializer)) {
                        next = new XMLTeePipe(next, localXMLSerializer);
                        this.xmlSerializerArray.add(localXMLSerializer);
                        localXMLSerializer = null;

            }
            //  else the serializer is cacheable but has views
            else if (this.nextIsCachePoint && !(prev instanceof XMLDeserializer) &&
                            cacheableTransformerCount == this.firstNotCacheableTransformerIndex) {
                        cachePointXMLSerializer = ((XMLSerializer)this.manager.lookup( XMLSerializer.ROLE ));
                        next = new XMLTeePipe(next,  cachePointXMLSerializer);
                        this.xmlSerializerArray.add(cachePointXMLSerializer);
                    }
                    this.connect(environment, prev, next);
                }

View Full Code Here

Examples of org.apache.cocoon.components.sax.XMLTeePipe

            if (this.getLogger().isDebugEnabled()) {
                this.getLogger().debug("Streaming directly from source.");
            }
            if (session.getExpires() > 0) {
                serializer = (XMLSerializer)this.manager.lookup(XMLSerializer.ROLE);
                XMLTeePipe tee = new XMLTeePipe(handler, serializer);
               
                SourceUtil.toSAX(source, tee);
               
                SourceValidity[] validities = new SourceValidity[1];
                validities[0] = session.getExpiresValidity();
View Full Code Here

Examples of org.apache.cocoon.components.sax.XMLTeePipe

                // Connect next component.
                next = (XMLConsumer) itt.next();
                if (xmlSerializer != null) {
                    if (cacheableTransformerCount == 0) {
                        next = new XMLTeePipe(next, xmlSerializer);
                        xmlSerializer = null;
                    } else {
                        cacheableTransformerCount--;
                    }
                }
                prev.setConsumer(next);
                prev = (XMLProducer) next;
            }

            if (configuredSAXConnector) {
                // insert SAXConnector
                SAXConnector connect = (SAXConnector) this.manager.lookup(SAXConnector.ROLE);
                connect.setup(environment,environment.getObjectModel(),null,null);
                this.connectors.add(connect);
                next = connect;
                prev.setConsumer(next);
                prev = connect;
            }

            // insert this consumer
            next = super.xmlConsumer;
            if (xmlSerializer != null) {
                next = new XMLTeePipe(next, xmlSerializer);
                xmlSerializer = null;
            }
            prev.setConsumer(next);

        } catch ( IOException e ) {
View Full Code Here

Examples of org.apache.cocoon.components.sax.XMLTeePipe

                // Connect next component.
                next = (XMLConsumer) itt.next();
                if (xmlSerializer != null) {
                    if (cacheableTransformerCount == 0) {
                        next = new XMLTeePipe(next, xmlSerializer);
                        xmlSerializer = null;
                    } else {
                        cacheableTransformerCount--;
                    }
                }
                prev.setConsumer(next);
                prev = (XMLProducer) next;
            }

            if (this.configuredSAXConnector == true) {
                // insert SAXConnector
                SAXConnector connect = (SAXConnector) this.manager.lookup(SAXConnector.ROLE);
                connect.setup(environment,environment.getObjectModel(),null,null);
                this.connectors.add(connect);
                next = connect;
                prev.setConsumer(next);
                prev = connect;
            }

            // insert this consumer
            next = super.xmlConsumer;
            if (xmlSerializer != null) {
                next = new XMLTeePipe(next, xmlSerializer);
                xmlSerializer = null;
            }
            prev.setConsumer(next);

        } catch ( IOException e ) {
View Full Code Here

Examples of org.apache.cocoon.components.sax.XMLTeePipe

                            if ( (this.isCachePoint.get(currentTransformerIndex) != null&&
                                    ((Boolean)this.isCachePoint.get(currentTransformerIndex)).booleanValue()) {

                                cachePointXMLSerializer = ((XMLSerializer)
                                this.manager.lookup( XMLSerializer.ROLE ));
                                next = new XMLTeePipe(next, cachePointXMLSerializer);
                                this.xmlSerializerArray.add(cachePointXMLSerializer);
                            }
                        }


                // Serializer is not cacheable,
            // but we  have the longest cacheable key. Do default longest key caching
                        if (localXMLSerializer != null) {
                            if (cacheableTransformerCount == 0) {
                                next = new XMLTeePipe(next, localXMLSerializer);
                                this.xmlSerializerArray.add(localXMLSerializer);
                                localXMLSerializer = null;
                            } else {
                                cacheableTransformerCount--;
                            }
                        }
                        this.connect(environment, prev, next);
                        prev = (XMLProducer) next;

                        currentTransformerIndex++;
                    }
                    next = super.lastConsumer;


            // if the serializer is not cacheable, but all the transformers are:
            // (this is default longest key caching)
                    if (localXMLSerializer != null) {
                        next = new XMLTeePipe(next, localXMLSerializer);
                        this.xmlSerializerArray.add(localXMLSerializer);
                        localXMLSerializer = null;
                    }

            // else if the serializer is cacheable and has cocoon views
                    else if ((currentTransformerIndex == this.firstNotCacheableTransformerIndex) &&
                            this.nextIsCachePoint) {
                        cachePointXMLSerializer = ((XMLSerializer)this.manager.lookup( XMLSerializer.ROLE ));
                        next = new XMLTeePipe(next, cachePointXMLSerializer);
                        this.xmlSerializerArray.add(cachePointXMLSerializer);
                    }
                    this.connect(environment, prev, next);


                } else {
                    // Here the first part of the pipeline has been retrived from cache
                    // we now check if any part of the rest of the pipeline can be cached
                    this.xmlDeserializer = (XMLDeserializer)this.manager.lookup(XMLDeserializer.ROLE);
                    // connect the pipeline:
                    XMLProducer prev = xmlDeserializer;
                    XMLConsumer next;
                    int cacheableTransformerCount = 0;
                    Iterator itt = this.transformers.iterator();
                    while ( itt.hasNext() ) {
                        next = (XMLConsumer) itt.next();

                        if (cacheableTransformerCount >= this.firstProcessedTransformerIndex) {

                // if we have cacheable transformers left,
                // then check the tranformers for cachepoints
                            if (cacheableTransformerCount < this.firstNotCacheableTransformerIndex) {
                                if ( !(prev instanceof XMLDeserializer) &&
                                        (this.isCachePoint.get(cacheableTransformerCount) != null&&
                                        ((Boolean)this.isCachePoint.get(cacheableTransformerCount)).booleanValue()) {
                                    cachePointXMLSerializer = ((XMLSerializer)this.manager.lookup( XMLSerializer.ROLE ));
                                    next = new XMLTeePipe(next, cachePointXMLSerializer);
                                    this.xmlSerializerArray.add(cachePointXMLSerializer);
                                }
                            }

                    // Serializer is not cacheable,
                // but we  have the longest cacheable key. Do default longest key caching
                            if (localXMLSerializer != null && !(prev instanceof XMLDeserializer)
                                    && cacheableTransformerCount == this.firstNotCacheableTransformerIndex) {
                                next = new XMLTeePipe(next, localXMLSerializer);
                                this.xmlSerializerArray.add(localXMLSerializer);
                                localXMLSerializer = null;
                            }
                            this.connect(environment, prev, next);
                            prev = (XMLProducer)next;
                        }
                        cacheableTransformerCount++;
                    }
                    next = super.lastConsumer;

            //*all* the transformers are cacheable, but the serializer is not!! this is longest key
                    if (localXMLSerializer != null && !(prev instanceof XMLDeserializer)) {
                        next = new XMLTeePipe(next, localXMLSerializer);
                        this.xmlSerializerArray.add(localXMLSerializer);
                        localXMLSerializer = null;

            }
            //  else the serializer is cacheable but has views
            else if (this.nextIsCachePoint && !(prev instanceof XMLDeserializer) &&
                            cacheableTransformerCount == this.firstNotCacheableTransformerIndex) {
                        cachePointXMLSerializer = ((XMLSerializer)this.manager.lookup( XMLSerializer.ROLE ));
                        next = new XMLTeePipe(next,  cachePointXMLSerializer);
                        this.xmlSerializerArray.add(cachePointXMLSerializer);
                    }
                    this.connect(environment, prev, next);
                }

View Full Code Here

Examples of org.apache.cocoon.components.sax.XMLTeePipe

                // if we cache, we need an xml serializer
                if ( this.cacheExpires > 0) {
                    try {
                        final XMLConsumer old = this.lastConsumer;
                        this.xmlSerializer = (XMLSerializer)this.manager.lookup( XMLSerializer.ROLE );
                        this.lastConsumer = new XMLTeePipe(this.lastConsumer, this.xmlSerializer);
       
                        super.connectPipeline( environment );
       
                        this.lastConsumer = old;
                    } catch ( ComponentException e ) {
View Full Code Here

Examples of org.apache.cocoon.components.sax.XMLTeePipe

            if (this.getLogger().isDebugEnabled()) {
                this.getLogger().debug("Streaming directly from source.");
            }
            if (session.getExpires() > 0) {
                serializer = (XMLSerializer)this.manager.lookup(XMLSerializer.ROLE);
                XMLTeePipe tee = new XMLTeePipe(handler, serializer);
               
                SourceUtil.toSAX(source, tee);
               
                SourceValidity[] validities = new SourceValidity[1];
                validities[0] = session.getExpiresValidity();
View Full Code Here

Examples of org.apache.cocoon.components.sax.XMLTeePipe

                            if ( (this.isCachePoint.get(currentTransformerIndex) != null&&
                                    ((Boolean)this.isCachePoint.get(currentTransformerIndex)).booleanValue()) {

                                cachePointXMLSerializer = ((XMLSerializer)
                                this.manager.lookup( XMLSerializer.ROLE ));
                                next = new XMLTeePipe(next, cachePointXMLSerializer);
                                this.xmlSerializerArray.add(cachePointXMLSerializer);
                            }
                        }


                        // Serializer is not cacheable,
                        // but we  have the longest cacheable key. Do default longest key caching
                        if (localXMLSerializer != null) {
                            if (cacheableTransformerCount == 0) {
                                next = new XMLTeePipe(next, localXMLSerializer);
                                this.xmlSerializerArray.add(localXMLSerializer);
                                localXMLSerializer = null;
                            } else {
                                cacheableTransformerCount--;
                            }
                        }
                        this.connect(environment, prev, next);
                        prev = (XMLProducer) next;

                        currentTransformerIndex++;
                    }
                    next = super.lastConsumer;


                    // if the serializer is not cacheable, but all the transformers are:
                    // (this is default longest key caching)
                    if (localXMLSerializer != null) {
                        next = new XMLTeePipe(next, localXMLSerializer);
                        this.xmlSerializerArray.add(localXMLSerializer);
                        localXMLSerializer = null;
                    }

                    // else if the serializer is cacheable and has cocoon views
                    else if ((currentTransformerIndex == this.firstNotCacheableTransformerIndex) &&
                            this.nextIsCachePoint) {
                        cachePointXMLSerializer = ((XMLSerializer)this.manager.lookup( XMLSerializer.ROLE ));
                        next = new XMLTeePipe(next, cachePointXMLSerializer);
                        this.xmlSerializerArray.add(cachePointXMLSerializer);
                    }
                    this.connect(environment, prev, next);


                } else {
                    // Here the first part of the pipeline has been retrived from cache
                    // we now check if any part of the rest of the pipeline can be cached
                    this.xmlDeserializer = (XMLDeserializer)this.manager.lookup(XMLDeserializer.ROLE);
                    // connect the pipeline:
                    XMLProducer prev = xmlDeserializer;
                    XMLConsumer next;
                    int cacheableTransformerCount = 0;
                    Iterator itt = this.transformers.iterator();
                    while ( itt.hasNext() ) {
                        next = (XMLConsumer) itt.next();

                        if (cacheableTransformerCount >= this.firstProcessedTransformerIndex) {

                            // if we have cacheable transformers left,
                            // then check the tranformers for cachepoints
                            if (cacheableTransformerCount < this.firstNotCacheableTransformerIndex) {
                                if ( !(prev instanceof XMLDeserializer) &&
                                        (this.isCachePoint.get(cacheableTransformerCount) != null&&
                                        ((Boolean)this.isCachePoint.get(cacheableTransformerCount)).booleanValue()) {
                                    cachePointXMLSerializer = ((XMLSerializer)this.manager.lookup( XMLSerializer.ROLE ));
                                    next = new XMLTeePipe(next, cachePointXMLSerializer);
                                    this.xmlSerializerArray.add(cachePointXMLSerializer);
                                }
                            }

                            // Serializer is not cacheable,
                            // but we  have the longest cacheable key. Do default longest key caching
                            if (localXMLSerializer != null && !(prev instanceof XMLDeserializer)
                                    && cacheableTransformerCount == this.firstNotCacheableTransformerIndex) {
                                next = new XMLTeePipe(next, localXMLSerializer);
                                this.xmlSerializerArray.add(localXMLSerializer);
                                localXMLSerializer = null;
                            }
                            this.connect(environment, prev, next);
                            prev = (XMLProducer)next;
                        }
                        cacheableTransformerCount++;
                    }
                    next = super.lastConsumer;

                    //*all* the transformers are cacheable, but the serializer is not!! this is longest key
                    if (localXMLSerializer != null && !(prev instanceof XMLDeserializer)) {
                        next = new XMLTeePipe(next, localXMLSerializer);
                        this.xmlSerializerArray.add(localXMLSerializer);
                        localXMLSerializer = null;

            }
            //  else the serializer is cacheable but has views
            else if (this.nextIsCachePoint && !(prev instanceof XMLDeserializer) &&
                            cacheableTransformerCount == this.firstNotCacheableTransformerIndex) {
                        cachePointXMLSerializer = ((XMLSerializer)this.manager.lookup( XMLSerializer.ROLE ));
                        next = new XMLTeePipe(next,  cachePointXMLSerializer);
                        this.xmlSerializerArray.add(cachePointXMLSerializer);
                    }
                    this.connect(environment, prev, next);
                }

View Full Code Here

Examples of org.apache.cocoon.components.sax.XMLTeePipe

                    Iterator itt = this.transformers.iterator();
                    while ( itt.hasNext() ) {
                        next = (XMLConsumer) itt.next();
                        if (localXMLSerializer != null) {
                            if (cacheableTransformerCount == 0) {
                                next = new XMLTeePipe(next, localXMLSerializer);
                                localXMLSerializer = null;
                            } else {
                                cacheableTransformerCount--;
                            }
                        }
                        this.connect(environment, prev, next);
                        prev = (XMLProducer) next;
                    }
                    next = super.lastConsumer;
                    if (localXMLSerializer != null) {
                        next = new XMLTeePipe(next, localXMLSerializer);
                        localXMLSerializer = null;
                    }
                    this.connect(environment, prev, next);
                } else {
                    this.xmlDeserializer = (XMLDeserializer)this.manager.lookup(XMLDeserializer.ROLE);
                    // connect the pipeline:
                    XMLProducer prev = xmlDeserializer;
                    XMLConsumer next;
                    int cacheableTransformerCount = 0;
                    Iterator itt = this.transformers.iterator();
                    while ( itt.hasNext() ) {
                        next = (XMLConsumer) itt.next();
                        if (cacheableTransformerCount >= this.firstProcessedTransformerIndex) {
                            if (localXMLSerializer != null
                                    && cacheableTransformerCount == this.firstNotCacheableTransformerIndex) {
                                next = new XMLTeePipe(next, localXMLSerializer);
                                localXMLSerializer = null;
                            }
                            this.connect(environment, prev, next);
                            prev = (XMLProducer)next;
                        }
                        cacheableTransformerCount++;
                    }
                    next = super.lastConsumer;
                    if (localXMLSerializer != null) {
                        next = new XMLTeePipe(next, localXMLSerializer);
                        localXMLSerializer = null;
                    }
                    this.connect(environment, prev, next);
                }
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.