Package org.apache.cocoon.caching

Examples of org.apache.cocoon.caching.ExtendedCachedResponse


            baos.flush();
            inputStream.close();
           
            // update cache
            final byte[] xmlResponse = this.cachedResponse.getAlternativeResponse();
            this.cachedResponse = new ExtendedCachedResponse(this.cachedResponse.getValidityObjects(),
                                                             baos.toByteArray());
            this.cachedResponse.setAlternativeResponse(xmlResponse);
            try {
                this.cache.store(this.streamKey, this.cachedResponse);
            } catch (ProcessingException ignore) {
View Full Code Here


            while ((length = inputStream.read(buffer)) > -1) {
                baos.write(buffer, 0, length);
            }
            baos.flush();
            inputStream.close();
            this.cachedResponse = new ExtendedCachedResponse(new ExpiresValidity(this.expires),
                                                             baos.toByteArray());                                                           
            storeResponse = true;                                                            
        } else if ( this.cachedResponse == null ) {
            this.cachedResponse = new ExtendedCachedResponse(new ExpiresValidity(this.expires),
                                                             null);                                                           
        }
       
        // we cache both
        if ( alternative && this.cachedResponse.getAlternativeResponse() == null ) {
View Full Code Here

                    this.manager.release(parser);
                    this.manager.release(serializer);
                }
               
                SourceValidity val = new ExpiresValidity(this.expires);
                ExtendedCachedResponse response = new ExtendedCachedResponse(val, content);
                response.setAlternativeResponse(cachedResponse);
                cache.store(cacheKey, response);
           
            } catch (Exception ignore) {
                this.getLogger().error("Exception during updating " +this.uri, ignore);
            } finally {
View Full Code Here

            while ((length = inputStream.read(buffer)) > -1) {
                baos.write(buffer, 0, length);
            }
            baos.flush();
            inputStream.close();
            this.cachedResponse = new ExtendedCachedResponse(new ExpiresValidity(this.expires),
                                                             baos.toByteArray());                                                           
            storeResponse = true;                                                            
        } else if ( this.cachedResponse == null ) {
            this.cachedResponse = new ExtendedCachedResponse(new ExpiresValidity(this.expires),
                                                             null);                                                           
        }
       
        // we cache both
        if ( alternative && this.cachedResponse.getAlternativeResponse() == null ) {
View Full Code Here

                    this.manager.release((Component)parser);
                    this.manager.release(serializer);
                }
               
                SourceValidity val = new ExpiresValidity(this.expires);
                ExtendedCachedResponse response = new ExtendedCachedResponse(val, content);
                response.setAlternativeResponse(cachedResponse);
                cache.store(cacheKey, response);
           
            } catch (Exception ignore) {
                this.getLogger().error("Exception during updating " +this.uri, ignore);
            } finally {
View Full Code Here

            baos.flush();
            inputStream.close();
           
            // update cache
            final byte[] xmlResponse = this.cachedResponse.getAlternativeResponse();
            this.cachedResponse = new ExtendedCachedResponse(this.cachedResponse.getValidityObjects(),
                                                             baos.toByteArray());
            this.cachedResponse.setAlternativeResponse(xmlResponse);
            try {
                this.cache.store(this.streamKey, this.cachedResponse);
            } catch (ProcessingException ignore) {
View Full Code Here

TOP

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

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.