Package org.apache.http.impl.client.cache

Examples of org.apache.http.impl.client.cache.DefaultHttpCacheEntrySerializer


     * @param config cache storage configuration options - note that
     *   the setting for max object size <b>will be ignored</b> and
     *   should be configured in the Ehcache instead.
     */
    public EhcacheHttpCacheStorage(Ehcache cache, CacheConfig config){
        this(cache, config, new DefaultHttpCacheEntrySerializer());
    }
View Full Code Here


        private final HttpCacheEntrySerializer serializer;


        private MapHttpCacheStorage(ConcurrentMap<String, byte[]> cache) {
            this.cache      = cache;
            this.serializer = new DefaultHttpCacheEntrySerializer();
        }
View Full Code Here

     * Create a storage backend using the pre-configured given
     * <i>memcached</i> client.
     * @param cache client to use for communicating with <i>memcached</i>
     */
    public MemcachedHttpCacheStorage(MemcachedClientIF cache) {
        this(cache, new CacheConfig(), new DefaultHttpCacheEntrySerializer());
    }
View Full Code Here

     * Constructs a storage backend using the provided Ehcache
     * with default configuration options.
     * @param cache where to store cached origin responses
     */
    public EhcacheHttpCacheStorage(Ehcache cache) {
        this(cache, new CacheConfig(), new DefaultHttpCacheEntrySerializer());
    }
View Full Code Here

     * @param config cache storage configuration options - note that
     *   the setting for max object size <b>will be ignored</b> and
     *   should be configured in the Ehcache instead.
     */
    public EhcacheHttpCacheStorage(Ehcache cache, CacheConfig config){
        this(cache, config, new DefaultHttpCacheEntrySerializer());
    }
View Full Code Here

     * Create a storage backend using the pre-configured given
     * <i>memcached</i> client.
     * @param cache client to use for communicating with <i>memcached</i>
     */
    public MemcachedHttpCacheStorage(MemcachedClientIF cache) {
        this(cache, new CacheConfig(), new DefaultHttpCacheEntrySerializer());
    }
View Full Code Here

         * serialize to the same bytes seems simpler, on the whole,
         * (while still making for a somewhat yucky test). At
         * least we encapsulate it off here in its own method so
         * the test that uses it remains clear.
         */
        final DefaultHttpCacheEntrySerializer ser = new DefaultHttpCacheEntrySerializer();
        final ByteArrayOutputStream bos1 = new ByteArrayOutputStream();
        ser.writeTo(entry, bos1);
        final byte[] bytes1 = bos1.toByteArray();
        final ByteArrayOutputStream bos2 = new ByteArrayOutputStream();
        ser.writeTo(resultEntry, bos2);
        final byte[] bytes2 = bos2.toByteArray();
        assertEquals(bytes1.length, bytes2.length);
        for(int i = 0; i < bytes1.length; i++) {
            assertEquals(bytes1[i], bytes2[i]);
        }
View Full Code Here

         * serialize to the same bytes seems simpler, on the whole,
         * (while still making for a somewhat yucky test). At
         * least we encapsulate it off here in its own method so
         * the test that uses it remains clear.
         */
        final DefaultHttpCacheEntrySerializer ser = new DefaultHttpCacheEntrySerializer();
        final ByteArrayOutputStream bos1 = new ByteArrayOutputStream();
        ser.writeTo(entry, bos1);
        final byte[] bytes1 = bos1.toByteArray();
        final ByteArrayOutputStream bos2 = new ByteArrayOutputStream();
        ser.writeTo(resultEntry, bos2);
        final byte[] bytes2 = bos2.toByteArray();
        assertEquals(bytes1.length, bytes2.length);
        for(int i = 0; i < bytes1.length; i++) {
            assertEquals(bytes1[i], bytes2[i]);
        }
View Full Code Here

TOP

Related Classes of org.apache.http.impl.client.cache.DefaultHttpCacheEntrySerializer

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.