Package com.caucho.server.cache

Examples of com.caucho.server.cache.AbstractCacheFilterChain


    if (_isCommitted)
      return;
   
    _isCommitted = true;

    AbstractCacheFilterChain cacheInvocation
      = _response.getCacheInvocation();

    if (cacheInvocation == null)
      return;
    // _cacheInvocation = cacheInvocation;

    String contentType = null;
    String charEncoding = null;

    int contentLength = -1;

    AbstractCacheEntry cacheEntry
      = cacheInvocation.startCaching(_response.getRequest(), _response,
                                     _headerKeys, _headerValues,
                                     contentType,
                                     charEncoding,
                                     contentLength);
   
View Full Code Here


  }

  public void completeCache()
  {

    AbstractCacheFilterChain cache = _response.getCacheInvocation();
     
    try {
      flushBuffer();
     
      OutputStream cacheStream = _cacheStream;
      _cacheStream = null;

      Writer cacheWriter = getCharCacheStream();
      setCharCacheStream(null);

      if (cacheStream != null)
        cacheStream.close();

      if (cacheWriter != null)
        cacheWriter.close();

      if (cache != null)
        cache.finishCaching(_response);
    } catch (IOException e) {
      log.log(Level.WARNING, e.toString(), e);
    } finally {
      // _response.setCacheInvocation(null);

      if (cache != null)
        cache.killCaching(_response);
    }
  }
View Full Code Here

  }

  private void closeCache()
    throws IOException
  {
    AbstractCacheFilterChain cache = _response.getCacheInvocation();

    OutputStream cacheStream = _cacheStream;
    _cacheStream = null;

    Writer cacheWriter = getCharCacheStream();
    setCharCacheStream(null);

    if (cacheStream != null)
      cacheStream.close();

    if (cacheWriter != null)
      cacheWriter.close();

    if (cache != null)
      cache.killCaching(_response);
  }
View Full Code Here

    // server/13de
    if (_cacheInvocation != null)
      return;

    AbstractCacheFilterChain cacheInvocation = res.getCacheInvocation();

    if (cacheInvocation == null)
      return;

    _cacheInvocation = cacheInvocation;

    HttpServletRequestImpl req = _response.getRequest().getRequestFacade();

    ArrayList<String> keys = res.getHeaderKeys();
    ArrayList<String> values = res.getHeaderValues();
    String contentType = res.getContentTypeImpl();
    String charEncoding = res.getCharacterEncodingImpl();

    int contentLength = -1;

    AbstractCacheEntry newCacheEntry
      = cacheInvocation.startCaching(req, res,
                                     keys, values,
                                     contentType,
                                     charEncoding,
                                     contentLength);
View Full Code Here

  }

  @Override
  public void killCaching()
  {
    AbstractCacheFilterChain cacheInvocation = _cacheInvocation;
   
    if (cacheInvocation != null) {
      HttpServletResponseImpl res = _response.getRequest().getResponseFacade();
     
      cacheInvocation.killCaching(res);
      setByteCacheStream(null);
      setCharCacheStream(null);
    }
  }
View Full Code Here

        cacheStream.close();

      if (cacheWriter != null)
        cacheWriter.close();
     
      AbstractCacheFilterChain cache = _cacheInvocation;

      if (cache != null && res != null) {
        _cacheInvocation = null;

        WebApp webApp = res.getRequest().getWebApp();
        if (webApp != null && webApp.isActive()) {
          cache.finishCaching(res);
        }
      }
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
    } finally {
      AbstractCacheFilterChain cache = _cacheInvocation;
      _cacheInvocation = null;

      if (cache != null)
        cache.killCaching(res);
    }
  }
View Full Code Here

    }
  }

  private void closeCache()
  {
    AbstractCacheFilterChain cache = _cacheInvocation;
    _cacheInvocation = null;

    HttpServletResponseImpl res = _response.getRequest().getResponseFacade();
   
    try {
      OutputStream cacheStream = getByteCacheStream();
      setByteCacheStream(null);

      Writer cacheWriter = getCharCacheStream();
      setCharCacheStream(null);

      if (cacheStream != null)
        cacheStream.close();

      if (cacheWriter != null)
        cacheWriter.close();
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
    } finally {
      if (cache != null)
        cache.killCaching(res);
    }
  }
View Full Code Here

    if (_isCommitted)
      return;
   
    _isCommitted = true;

    AbstractCacheFilterChain cacheInvocation
      = _response.getCacheInvocation();

    if (cacheInvocation == null)
      return;
    // _cacheInvocation = cacheInvocation;

    String contentType = null;
    String charEncoding = null;

    int contentLength = -1;

    _cacheEntry
      = cacheInvocation.startCaching(_response.getRequest(), _response,
                                     _headerKeys, _headerValues,
                                     contentType,
                                     charEncoding,
                                     contentLength);
   
View Full Code Here

  }

  public void finishCache()
    throws IOException
  {
    AbstractCacheFilterChain cache = _response.getCacheInvocation();
     
    try {
      OutputStream cacheStream = _cacheStream;
      _cacheStream = null;

      Writer cacheWriter = getCharCacheStream();
      setCharCacheStream(null);

      if (cacheStream != null)
        cacheStream.close();

      if (cacheWriter != null)
        cacheWriter.close();

      AbstractCacheEntry cacheEntry = _cacheEntry;

      if (cacheEntry != null) {
        _cacheEntry = null;

        if (cache != null)
          cache.finishCaching(cacheEntry);
      }
    } finally {
      // _response.setCacheInvocation(null);

      AbstractCacheEntry cacheEntry = _cacheEntry;
      _cacheEntry = null;

      if (cache != null && cacheEntry != null)
        cache.killCaching(cacheEntry);
    }
  }
View Full Code Here

   
    // server/13de
    if (_cacheInvocation != null)
      return;

    AbstractCacheFilterChain cacheInvocation = res.getCacheInvocation();

    if (cacheInvocation == null)
      return;

    _cacheInvocation = cacheInvocation;

    HttpServletRequestImpl req = _response.getRequest().getRequestFacade();

    ArrayList<String> keys = res.getHeaderKeys();
    ArrayList<String> values = res.getHeaderValues();
    String contentType = res.getContentTypeImpl();
    String charEncoding = res.getCharacterEncodingImpl();

    int contentLength = -1;

    AbstractCacheEntry newCacheEntry
      = cacheInvocation.startCaching(req, res,
                                     keys, values,
                                     contentType,
                                     charEncoding,
                                     contentLength);
View Full Code Here

TOP

Related Classes of com.caucho.server.cache.AbstractCacheFilterChain

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.