Examples of AggregatedValidity


Examples of org.apache.excalibur.source.impl.validity.AggregatedValidity

            return null;
        }

        // Check includes
        if (m_checkIncludes) {
            AggregatedValidity aggregated;
            List includes = (List) templateAndValidityAndIncludes[2];
            if (includes != null) {
                aggregated = new AggregatedValidity();
                aggregated.add(storedValidity);

                for (int i = includes.size() - 1; i >= 0; i--) {
                    // Every include stored as pair of source ID and validity
                    Object[] pair = (Object[]) includes.get(i);
                    storedValidity = (SourceValidity) pair[1];
                    aggregated.add(storedValidity);

                    valid = storedValidity.isValid();
                    if (valid == SourceValidity.UNKNOWN) {
                        Source includedSource = null;
                        try {
View Full Code Here

Examples of org.apache.excalibur.source.impl.validity.AggregatedValidity

     * @return The generated validity object or <code>null</code> if the
     *         component is currently not cacheable.
     */
    public SourceValidity getValidity() {
        try {
            AggregatedValidity v = new AggregatedValidity();
            for (int i = 0; i < this.parts.size(); i++) {
                final Source current = ((Part) this.parts.get(i)).source;
                final SourceValidity sv = current.getValidity();

                if (sv == null) {
                    return null;
                } else {
                    v.add(sv);
                }
            }

            return v;
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.excalibur.source.impl.validity.AggregatedValidity

     * @return The generated validity object or <code>null</code> if the
     *         component is currently not cacheable.
     */
    public SourceValidity getValidity() {

        AggregatedValidity validity = new AggregatedValidity();

        Source source;

        for (Enumeration e = cachedsources.elements(); e.hasMoreElements(); ) {
            source = (Source) e.nextElement();

            validity.add(source.getValidity());
        }

        return validity;
    }
View Full Code Here

Examples of org.apache.excalibur.source.impl.validity.AggregatedValidity

                    final TransformerHandler handler = m_factory.newTransformerHandler( template );
                    handler.getTransformer().setErrorListener( m_errorHandler );
                    handler.getTransformer().setURIResolver( this );

                    // Create aggregated validity
                    AggregatedValidity aggregated = null;
                   

                   
                    if( validity != null && m_checkIncludes)
                     
                    {
                        List includes = (List)m_includesMap.get( m_id );
                        if( includes != null )
                        {
                            aggregated = new AggregatedValidity();
                            aggregated.add( validity );
                            for( int i = includes.size() - 1; i >= 0; i-- )
                            {
                                aggregated.add( (SourceValidity)( (Object[])includes.get( i ) )[ 1 ] );
                            }
                            validity = aggregated;
                        }
                    }
View Full Code Here

Examples of org.apache.excalibur.source.impl.validity.AggregatedValidity

        }

        // Check includes
        if ( m_checkIncludes )
        {
            AggregatedValidity aggregated = null;
            List includes = (List)templateAndValidityAndIncludes[ 2 ];
            if( includes != null )
            {
                aggregated = new AggregatedValidity();
                aggregated.add( storedValidity );
   
                for( int i = includes.size() - 1; i >= 0; i-- )
                {
                    // Every include stored as pair of source ID and validity
                    Object[] pair = (Object[])includes.get( i );
                    storedValidity = (SourceValidity)pair[ 1 ];
                    aggregated.add( storedValidity );
   
                    valid = storedValidity.isValid();
                    isValid = false;
                    if( valid == 0 )
                    {
View Full Code Here

Examples of org.apache.excalibur.source.impl.validity.AggregatedValidity

     */
    public ValidationResolver(SourceResolver sourceResolver,
                              EntityResolver entityResolver) {
        if (sourceResolver == null) throw new NullPointerException("Null source");
        if (entityResolver == null) throw new NullPointerException("Null entity");
        this.sourceValidity = new AggregatedValidity();
        this.sourceResolver = sourceResolver;
        this.entityResolver = entityResolver;
    }
View Full Code Here

Examples of org.apache.excalibur.source.impl.validity.AggregatedValidity

            }

            if (this.toCacheSourceValidities != null) {
                // This means that the pipeline is valid based on the validities
                // of the individual components
                final AggregatedValidity validity = new AggregatedValidity();
                for (int i=0; i < this.toCacheSourceValidities.length; i++) {
                    validity.add(this.toCacheSourceValidities[i]);
                }

                return validity;
            }

            // This means that the pipeline is valid because it has not yet expired
            return NOPValidity.SHARED_INSTANCE;
        } else {
            int vals = 0;

            if (null != this.toCacheKey
                    && !this.cacheCompleteResponse
                    && this.firstNotCacheableTransformerIndex == super.transformers.size()) {
                vals = this.toCacheKey.size();
            } else if (null != this.fromCacheKey
                    && !this.completeResponseIsCached
                    && this.firstProcessedTransformerIndex == super.transformers.size()) {
                vals = this.fromCacheKey.size();
            }

            if (vals > 0) {
                final AggregatedValidity validity = new AggregatedValidity();
                for (int i = 0; i < vals; i++) {
                    validity.add(getValidityForInternalPipeline(i));
                }

                return validity;
            }
View Full Code Here

Examples of org.apache.excalibur.source.impl.validity.AggregatedValidity

      if (m_eventfactory == null) {
        return null;
      }
     
        if (m_validity == null) {
            m_validity = new AggregatedValidity();
        }
        return m_validity;
    }
View Full Code Here

Examples of org.apache.excalibur.source.impl.validity.AggregatedValidity

     * @return The generated validity object or <code>null</code> if the
     *         component is currently not cacheable.
     */
    public SourceValidity getValidity() {
        try {
            AggregatedValidity v = new AggregatedValidity();
            for (int i = 0; i < this.parts.size(); i++) {
                final Source current = ((Part) this.parts.get(i)).source;
                final SourceValidity sv = current.getValidity();

                if (sv == null) {
                    return null;
                } else {
                    v.add(sv);
                }
            }

            return v;
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.excalibur.source.impl.validity.AggregatedValidity

                final TransformerHandler handler = m_factory.newTransformerHandler(template);
                handler.getTransformer().setErrorListener(new TraxErrorListener(getLogger(), stylesheet.getURI()));
                handler.getTransformer().setURIResolver(this);

                // Create aggregated validity
                AggregatedValidity aggregated = null;
                if (validity != null && m_checkIncludes) {
                    List includes = (List) m_includesMap.get(id);
                    if (includes != null) {
                        aggregated = new AggregatedValidity();
                        aggregated.add(validity);
                        for (int i = includes.size() - 1; i >= 0; i--) {
                            aggregated.add((SourceValidity) ((Object[]) includes.get(i))[1]);
                        }
                        validity = aggregated;
                    }
                }
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.