Examples of ResourceCache


Examples of org.mortbay.jetty.ResourceCache

        // Find the resource and content
        Resource resource=null;
        HttpContent content=null;
       
        Connector connector = HttpConnection.getCurrentConnection().getConnector();
        ResourceCache cache=(connector instanceof NIOConnector) ?_nioCache:_bioCache;
        try
        {  
            // Try gzipped content first
            if (gzip)
            {
                pathInContextGz=pathInContext+".gz"
                resource=getResource(pathInContextGz);

                if (resource==null || !resource.exists()|| resource.isDirectory())
                {
                    gzip=false;
                    pathInContextGz=null;
                }
                else if (cache!=null)
                {
                    content=cache.lookup(pathInContextGz,resource);
                    if (content!=null)
                        resource=content.getResource();
                }

                if (resource==null || !resource.exists()|| resource.isDirectory())
                {
                    gzip=false;
                    pathInContextGz=null;
                }
            }
       
            // find resource
            if (!gzip)
            {
                if (cache==null)
                    resource=getResource(pathInContext);
                else
                {
                    content=cache.lookup(pathInContext,this);

                    if (content!=null)
                        resource=content.getResource();
                    else
                        resource=getResource(pathInContext);
View Full Code Here

Examples of org.mortbay.jetty.ResourceCache

            }
            if ("bio".equals(cache_type)|| "both".equals(cache_type))
            {
                if (max_cache_size==-2 || max_cache_size>0)
                {
                    _bioCache=new ResourceCache(_mimeTypes);
                    if (max_cache_size>0)
                        _bioCache.setMaxCacheSize(max_cache_size);   
                    if (max_cached_file_size>=-1)
                        _bioCache.setMaxCachedFileSize(max_cached_file_size);   
                    if (max_cached_files>=-1)
View Full Code Here

Examples of org.mortbay.jetty.ResourceCache

        // Find the resource and content
        Resource resource=null;
        HttpContent content=null;
       
        Connector connector = HttpConnection.getCurrentConnection().getConnector();
        ResourceCache cache=(connector instanceof NIOConnector) ?_nioCache:_bioCache;
        try
        {  
            // Try gzipped content first
            if (gzip)
            {
                pathInContextGz=pathInContext+".gz"
                resource=getResource(pathInContextGz);

                if (resource==null || !resource.exists()|| resource.isDirectory())
                {
                    gzip=false;
                    pathInContextGz=null;
                }
                else if (cache!=null)
                {
                    content=cache.lookup(pathInContextGz,resource);
                    if (content!=null)
                        resource=content.getResource();
                }

                if (resource==null || !resource.exists()|| resource.isDirectory())
                {
                    gzip=false;
                    pathInContextGz=null;
                }
            }
       
            // find resource
            if (!gzip)
            {
                if (cache==null)
                    resource=getResource(pathInContext);
                else
                {
                    content=cache.lookup(pathInContext,this);

                    if (content!=null)
                        resource=content.getResource();
                    else
                        resource=getResource(pathInContext);
View Full Code Here

Examples of org.mortbay.jetty.ResourceCache

            }
            if ("bio".equals(cache_type)|| "both".equals(cache_type))
            {
                if (max_cache_size==-2 || max_cache_size>0)
                {
                    _bioCache=new ResourceCache(_mimeTypes);
                    if (max_cache_size>0)
                        _bioCache.setMaxCacheSize(max_cache_size);   
                    if (max_cached_file_size>=-1)
                        _bioCache.setMaxCachedFileSize(max_cached_file_size);   
                    if (max_cached_files>=-1)
View Full Code Here

Examples of org.mortbay.jetty.ResourceCache

        // Find the resource and content
        Resource resource=null;
        HttpContent content=null;
       
        Connector connector = HttpConnection.getCurrentConnection().getConnector();
        ResourceCache cache=(connector instanceof NIOConnector) ?_nioCache:_bioCache;
        try
        {  
            // Try gzipped content first
            if (gzip)
            {
                pathInContextGz=pathInContext+".gz"
                resource=getResource(pathInContextGz);

                if (resource==null || !resource.exists()|| resource.isDirectory())
                {
                    gzip=false;
                    pathInContextGz=null;
                }
                else if (cache!=null)
                {
                    content=cache.lookup(pathInContextGz,resource);
                    if (content!=null)
                        resource=content.getResource();
                }

                if (resource==null || !resource.exists()|| resource.isDirectory())
                {
                    gzip=false;
                    pathInContextGz=null;
                }
            }
       
            // find resource
            if (!gzip)
            {
                if (cache==null)
                    resource=getResource(pathInContext);
                else
                {
                    content=cache.lookup(pathInContext,this);

                    if (content!=null)
                        resource=content.getResource();
                    else
                        resource=getResource(pathInContext);
View Full Code Here

Examples of org.mortbay.jetty.ResourceCache

            }
            if ("bio".equals(cache_type)|| "both".equals(cache_type))
            {
                if (max_cache_size==-2 || max_cache_size>0)
                {
                    _bioCache=new ResourceCache(_mimeTypes);
                    if (max_cache_size>0)
                        _bioCache.setMaxCacheSize(max_cache_size);   
                    if (max_cached_file_size>=-1)
                        _bioCache.setMaxCachedFileSize(max_cached_file_size);   
                    if (max_cached_files>=-1)
View Full Code Here

Examples of org.mortbay.jetty.ResourceCache

        // Find the resource and content
        Resource resource=null;
        HttpContent content=null;
       
        Connector connector = HttpConnection.getCurrentConnection().getConnector();
        ResourceCache cache=(connector instanceof NIOConnector) ?_nioCache:_bioCache;
        try
        {  
            // Try gzipped content first
            if (gzip)
            {
                pathInContextGz=pathInContext+".gz"
                resource=getResource(pathInContextGz);

                if (resource==null || !resource.exists()|| resource.isDirectory())
                {
                    gzip=false;
                    pathInContextGz=null;
                }
                else if (cache!=null)
                {
                    content=cache.lookup(pathInContextGz,resource);
                    if (content!=null)
                        resource=content.getResource();
                }

                if (resource==null || !resource.exists()|| resource.isDirectory())
                {
                    gzip=false;
                    pathInContextGz=null;
                }
            }
       
            // find resource
            if (!gzip)
            {
                if (cache==null)
                    resource=getResource(pathInContext);
                else
                {
                    content=cache.lookup(pathInContext,this);

                    if (content!=null)
                        resource=content.getResource();
                    else
                        resource=getResource(pathInContext);
View Full Code Here

Examples of org.seattlegamer.spacegame.resources.ResourceCache

  @Test
  public void newGameCreatedWithPlayersFromManifest() throws IOException {
   
    Bus bus = new BusImpl();
    //TODO: use Mockito for dependencies
    ResourceCache resourceCache = new ResourceCache() {
      @Override public void putImage(String name, Object asset) {}
      @Override public Image getImage(String name) throws IOException { return null; }
    };
    DisplayMode displayMode = new DisplayMode(800, 600, 16, 60);
    MockGameState gameState = new MockGameState(bus, resourceCache, displayMode);
View Full Code Here

Examples of org.zkoss.util.resource.ResourceCache

    doGet(request, response);
  }

  private static final String ATTR_PAGE_CACHE = "org.zkoss.web.servlet.dsp.PageCache";
  private final ResourceCache getCache() {
    ResourceCache cache = (ResourceCache)_ctx.getAttribute(ATTR_PAGE_CACHE);
    if (cache == null) {
      synchronized (InterpreterServlet.class) {
        cache = (ResourceCache)_ctx.getAttribute(ATTR_PAGE_CACHE);
        if (cache == null) {
          cache = new ResourceCache(new MyLoader(), 29);
          cache.setMaxSize(1024);
          cache.setLifetime(60*60*1000); //1hr
          _ctx.setAttribute(ATTR_PAGE_CACHE, cache);
        }
      }
    }
    return cache;
View Full Code Here

Examples of org.zkoss.util.resource.ResourceCache

  //Extendlet//
  public void init(ExtendletConfig config) {
    _webctx = config.getExtendletContext();
    final ZumlLoader loader = new ZumlLoader();
    _cache = new ResourceCache(loader, 17);
    _cache.setMaxSize(512);
    _cache.setLifetime(60*60*1000); //1hr
    final int checkPeriod = loader.getCheckPeriod();
    _cache.setCheckPeriod(checkPeriod >= 0 ? checkPeriod: 60*60*1000); //1hr

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.