Package org.apache.cocoon.caching

Examples of org.apache.cocoon.caching.PipelineCacheKey


            this.environment.changeToLastContext();
                String redirectURL = this.environment.getRedirectURL();
                if (redirectURL == null) {
                    if (this.eventPipeline instanceof CacheableEventPipeline) {
                        CacheableEventPipeline cep = (CacheableEventPipeline)this.eventPipeline;
                        PipelineCacheKey pck = cep.generateKey(this.environment);
                        Map validity = null;
                        if (pck != null) {
                            validity = cep.generateValidity(this.environment);
                            if (validity != null) {
                                // the event pipeline is cacheable
                                // now calculate a last modification date
                                String hashKey = pck.toString() + validity.toString();
                                this.lastModificationDate = HashUtil.hash(hashKey);
                            }
                        }
                    }
                } else {
View Full Code Here


                String redirectURL = this.environment.getRedirectURL();
                if (redirectURL == null) {
                    if (this.eventPipeline.getGenerator() != null &&
                        this.eventPipeline instanceof CacheableEventPipeline) {
                        CacheableEventPipeline cep = (CacheableEventPipeline)this.eventPipeline;
                        PipelineCacheKey pck = cep.generateKey(this.environment);
                        Map validity = null;
                        if (pck != null) {
                            validity = cep.generateValidity(this.environment);
                            if (validity != null) {
                                // the event pipeline is cacheable
                                // now calculate a last modification date
                                String hashKey = pck.toString() + validity.toString();
                                this.lastModificationDate = HashUtil.hash(hashKey);
                            }
                        }
                    }
                } else {
View Full Code Here

        // to build a unique key of the request

        // is the generator cacheable?
        Serializable key = getGeneratorKey();
        if (key != null) {
            this.toCacheKey = new PipelineCacheKey();
            this.toCacheKey.addKey(
                    this.newComponentCacheKey(
                        ComponentCacheKey.ComponentType_Generator,
                        this.generatorRole, key));
View Full Code Here

        throws ProcessingException {
        try {
            boolean usedCache = false;
            OutputStream outputStream = null;
            SourceValidity readerValidity = null;
            PipelineCacheKey pcKey = null;

            // test if reader is cacheable
            Serializable readerKey = null;
            boolean isCacheableProcessingComponent = false;
            if (super.reader instanceof CacheableProcessingComponent) {
                readerKey = ((CacheableProcessingComponent)super.reader).getKey();
                isCacheableProcessingComponent = true;
            } else if (super.reader instanceof Cacheable) {
                readerKey = new Long(((Cacheable)super.reader).generateKey());
            }

            boolean finished = false;

            if (readerKey != null) {
                // response is cacheable, build the key
                pcKey = new PipelineCacheKey();
                pcKey.addKey(new ComponentCacheKey(ComponentCacheKey.ComponentType_Reader,
                            this.readerRole,
                            readerKey)
                        );

                while(!finished) {
View Full Code Here

             * a concurrent modification exception.
             */
            Object[] obs = coll.toArray();
            for (int i=0;i<obs.length; i++) {
                if (obs[i] != null) {
                    PipelineCacheKey pck = (PipelineCacheKey)obs[i];
                    if (getLogger().isDebugEnabled()) {
                        getLogger().debug("Processing cache event, found Pipeline key: " + pck.toString());
                    }
                    /* every pck associated with this event needs to be
                     * removed -- regardless of event mapping. and every
                     * event mapped to those keys needs to be removed
                     * recursively.
 
View Full Code Here

        if (super.generator instanceof CacheableProcessingComponent) {
            key = ((CacheableProcessingComponent) super.generator).getKey();
        }

        if (key != null) {
            this.toCacheKey = new PipelineCacheKey();
            this.toCacheKey.addKey(
                    newComponentCacheKey(
                            ComponentCacheKey.ComponentType_Generator,
                            this.generatorRole, key));
View Full Code Here

    protected boolean processReader(Environment  environment) throws ProcessingException {
        try {
            boolean usedCache = false;
            OutputStream outputStream = null;
            SourceValidity readerValidity = null;
            PipelineCacheKey pcKey = null;

            // test if reader is cacheable
            Serializable readerKey = null;
            if (super.reader instanceof CacheableProcessingComponent) {
                readerKey = ((CacheableProcessingComponent)super.reader).getKey();
            }

            boolean finished = false;

            if (readerKey != null) {
                // response is cacheable, build the key
                pcKey = new PipelineCacheKey();
                pcKey.addKey(new ComponentCacheKey(ComponentCacheKey.ComponentType_Reader,
                                                   this.readerRole,
                                                   readerKey));

                while (!finished) {
                    finished = true;
View Full Code Here

        // to build a unique key of the request

        // is the generator cacheable?
        Serializable key = getGeneratorKey();
        if (key != null) {
            this.toCacheKey = new PipelineCacheKey();
            this.toCacheKey.addKey(
                    this.newComponentCacheKey(
                            ComponentCacheKey.ComponentType_Generator,
                            this.generatorRole, key));
View Full Code Here

    throws ProcessingException {
        try {
            boolean usedCache = false;
            OutputStream outputStream = null;
            SourceValidity readerValidity = null;
            PipelineCacheKey pcKey = null;

            // test if reader is cacheable
            Serializable readerKey = null;
            boolean isCacheableProcessingComponent = false;
            if (super.reader instanceof CacheableProcessingComponent) {
                readerKey = ((CacheableProcessingComponent)super.reader).getKey();
                isCacheableProcessingComponent = true;
            } else if (super.reader instanceof Cacheable) {
                readerKey = new Long(((Cacheable)super.reader).generateKey());
            }

            boolean finished = false;
            if (readerKey != null) {
             
                // response is cacheable, build the key
                pcKey = new PipelineCacheKey();
                pcKey.addKey(new ComponentCacheKey(ComponentCacheKey.ComponentType_Reader,
                                                   this.readerRole,
                                                   readerKey)
                            );

                while(!finished) {
View Full Code Here

                if (redirectURL == null) {
                    if (this.eventPipeline.getGenerator() != null &&
                        this.eventPipeline instanceof CacheableEventPipeline)
                    {
                        CacheableEventPipeline cep = (CacheableEventPipeline)this.eventPipeline;
                        PipelineCacheKey pck = cep.generateKey(this.environment);
                        Map validity = null;
                        if (pck != null) {
                            validity = cep.generateValidity(this.environment);
                            if (validity != null) {
                                // the event pipeline is cacheable
                                // now calculate a last modification date
                                String hashKey = pck.toString() + validity.toString();
                                this.lastModificationDate = HashUtil.hash(hashKey);
                            }
                        }
                    }
               } else {
View Full Code Here

TOP

Related Classes of org.apache.cocoon.caching.PipelineCacheKey

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.