Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mortbay.jetty
Class ResourceCache

    java.lang.Object
      org.mortbay.component.AbstractLifeCycle
          org.mortbay.jetty.ResourceCache

All Implemented Interfaces:
  java.io.Serializable, LifeCycle

    public class ResourceCache

extends AbstractLifeCycle
implements java.io.Serializable

Author:
  Greg Wilkins
See Also:
  Serialized Form

Nested Class Summary
`class` | `ResourceCache.Content` MetaData associated with a context Resource.

Nested classes/interfaces inherited from interface org.mortbay.component.LifeCycle
`LifeCycle.Listener`

Field Summary
`protected java.util.Map` | `_cache`
`protected int` | `_cachedFiles`
`protected int` | `_cachedSize`
`protected ResourceCache.Content` | `_leastRecentlyUsed`
`protected ResourceCache.Content` | `_mostRecentlyUsed`

Fields inherited from class org.mortbay.component.AbstractLifeCycle
`_listeners`

Constructor Summary
`ResourceCache(MimeTypes mimeTypes)` Constructor.

Method Summary
`void` | `doStart()`
`void` | `doStop()` Stop the context.
`protected void` | `fill(ResourceCache.Content content)`
`void` | `flushCache()`
`int` | `getCachedFiles()`
`int` | `getCachedSize()`
`int` | `getMaxCachedFiles()`
`int` | `getMaxCachedFileSize()`
`int` | `getMaxCacheSize()`
`ResourceCache.Content` | `lookup(java.lang.String pathInContext, Resource resource)`
`ResourceCache.Content` | `lookup(java.lang.String pathInContext, ResourceFactory factory)` Get a Entry from the cache.
`void` | `setMaxCachedFiles(int maxCachedFiles)`
`void` | `setMaxCachedFileSize(int maxCachedFileSize)`
`void` | `setMaxCacheSize(int maxCacheSize)`

Methods inherited from class org.mortbay.component.AbstractLifeCycle
`addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### _cache

    protected transient java.util.Map _cache

### _cachedSize

    protected transient int _cachedSize

### _cachedFiles

    protected transient int _cachedFiles

### _mostRecentlyUsed

    protected transient ResourceCache.Content _mostRecentlyUsed

### _leastRecentlyUsed

    protected transient ResourceCache.Content _leastRecentlyUsed

Constructor Detail

### ResourceCache

    public ResourceCache(MimeTypes mimeTypes)

  Constructor.

Method Detail

### getCachedSize

    public int getCachedSize()

### getCachedFiles

    public int getCachedFiles()

### getMaxCachedFileSize

    public int getMaxCachedFileSize()

### setMaxCachedFileSize

    public void setMaxCachedFileSize(int maxCachedFileSize)

### getMaxCacheSize

    public int getMaxCacheSize()

### setMaxCacheSize

    public void setMaxCacheSize(int maxCacheSize)

### getMaxCachedFiles

    public int getMaxCachedFiles()

  Returns:
    Returns the maxCachedFiles.

### setMaxCachedFiles

    public void setMaxCachedFiles(int maxCachedFiles)

  Parameters:
    `maxCachedFiles` - The maxCachedFiles to set.

### flushCache

    public void flushCache()

### lookup

    public ResourceCache.Content lookup(java.lang.String pathInContext,
                                        ResourceFactory factory)
                                 throws java.io.IOException

  Get a Entry from the cache. Get either a valid entry object or create a new one if possible.

  Parameters:
    `pathInContext` - The key into the cache
    `factory` - If no matching entry is found, this `ResourceFactory` will be used to create the `Resource` for the new enry that is created.
  Returns:
    The entry matching `pathInContext`, or a new entry if no matching entry was found
  Throws:
    `java.io.IOException`

### lookup

    public ResourceCache.Content lookup(java.lang.String pathInContext,
                                        Resource resource)
                                 throws java.io.IOException

  Throws:
    `java.io.IOException`

### doStart

    public void doStart()
                 throws java.lang.Exception

  Overrides:
    `doStart` in class `AbstractLifeCycle`
  Throws:
    `java.lang.Exception`

### doStop

    public void doStop()
                throws java.lang.InterruptedException

  Stop the context.

  Overrides:
    `doStop` in class `AbstractLifeCycle`
  Throws:
    `java.lang.InterruptedException`

### fill

    protected void fill(ResourceCache.Content content)
                 throws java.io.IOException

  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.