Package org.apache.excalibur.source.impl.validity

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


        // and now prepare the caching information
        this.cacheKey = new SimpleCacheKey(key,
                                           this.serializer == this.lastConsumer);
        if ( this.cacheExpires > 0) {
            this.cacheValidity = new ExpiresValidity(this.cacheExpires*1000);                                              
        }
        final boolean purge = this.parameters.getParameterAsBoolean("purge-cache", false);
        
        this.cachedResponse = this.cache.get(this.cacheKey);
        if ( this.cachedResponse != null ) {
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

                } finally {
                    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) {
View Full Code Here

                    serializer = (XMLSerializer)manager.lookup(XMLSerializer.ROLE);
               
                    SourceUtil.toSAX(source, serializer);
               
                    SourceValidity[] validities = new SourceValidity[1];
                    validities[0] = new ExpiresValidity(((Long)object[2]).longValue() * 1000); // milliseconds!
                    CachedResponse response = new CachedResponse(validities,
                                                                 (byte[])serializer.getSAXFragment());
                    ((IncludeCacheStorageProxy)object[0]).put(uri, response);
                    
                } catch (Exception ignore) {
View Full Code Here

TOP

Related Classes of org.apache.excalibur.source.impl.validity.ExpiresValidity

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.