    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.www.protocol.http.cache.CacheState

    java.lang.Object
       |
       +----w3c.tools.store.AttributeHolder
               |
               +----w3c.tools.store.Resource
                       |
                       +----w3c.www.protocol.http.cache.CacheState

public class CacheState
extends Resource

##

ATTR_BASE_GENERATION
  Attribute index - The base generation we are using.
ATTR_CACHE_USED
  Attribute index - The number of bytes of cache disk used.
ATTR_COUNTER
  Attribute index - The counter, to use for file naming.
ATTR_GENERATION
  Attribute index - The cache sweeper current generation.
ATTR_GENERATIONS_SIZE
  Attribute index - The current generation sizes.
GENERATIONS_HISTORY_SIZE

##

CacheState()

##

computeCollectGeneration(int)
  Compute generation number to sweep, given amount of data to collect.
getBaseGeneration()
getCacheUsed()
getCurrentGenerationSize()
  Get current generation size.
getGeneration()
  Get the current collection generation number.
getGenerationsSize()
getNext()
initialize(Object[])
  Initialization method for attribute holders.
print(PrintStream)
  Debugging purposes only, print this attribute holder.
setBaseGeneration(int)
setGenerationsSize(int[])
setNextGeneration()
  Get the next collector generation number, and update state.
shiftGenerations(int)
updateCacheSpaceCounter(int)
  Update cache space counter.
updateGenerationSize(int, int)
  Update generations size

##

GENERATIONS_HISTORY_SIZE

      protected final static int GENERATIONS_HISTORY_SIZE

ATTR_COUNTER

      protected static int ATTR_COUNTER

  Attribute index - The counter, to use for file naming.

ATTR_CACHE_USED

      protected static int ATTR_CACHE_USED

  Attribute index - The number of bytes of cache disk used.

ATTR_GENERATION

      protected static int ATTR_GENERATION

  Attribute index - The cache sweeper current generation.

ATTR_GENERATIONS_SIZE

      protected static int ATTR_GENERATIONS_SIZE

  Attribute index - The current generation sizes.

ATTR_BASE_GENERATION

      protected static int ATTR_BASE_GENERATION

  Attribute index - The base generation we are using.

##

CacheState

      public CacheState()

##

getNext

      public synchronized int getNext()

getCacheUsed

      public synchronized int getCacheUsed()

getGeneration

      public int getGeneration()

  Get the current collection generation number.
  Returns:
    An integer, giving the current collector generation.

getBaseGeneration

      public int getBaseGeneration()

setBaseGeneration

      public void setBaseGeneration(int newbase)

getGenerationsSize

      public int[] getGenerationsSize()

setGenerationsSize

      public void setGenerationsSize(int sizes[])

shiftGenerations

      public synchronized void shiftGenerations(int g)

setNextGeneration

      public synchronized int setNextGeneration()

  Get the next collector generation number, and update state.
  Returns:
    The next (which will be current when the method returns) collector generation.

updateGenerationSize

      protected synchronized void updateGenerationSize(int generation,
                                                       int size)

  Update generations size
  Parameters:
    generation - The generation whose size is changing.
    size - The delta with previous size.

getCurrentGenerationSize

      protected synchronized int getCurrentGenerationSize()

  Get current generation size.
  Returns:
    The size in bytes of the current generation.

computeCollectGeneration

      protected synchronized int computeCollectGeneration(int size)

  Compute generation number to sweep, given amount of data to collect.
  Parameters:
    size - The size of data to be collected.

updateCacheSpaceCounter

      public synchronized int updateCacheSpaceCounter(int size)

  Update cache space counter.
  Parameters:
    size - The number of bytes used (if positif), or the number of bytes freed (if negative).
  Returns:
    The total number of bytes used.

print

      public void print(PrintStream out)

  Debugging purposes only, print this attribute holder.
  Overrides:
    print in class AttributeHolder

initialize

      public void initialize(Object values[])

  Initialization method for attribute holders.
  Overrides:
    initialize in class AttributeHolder

    All Packages  Class Hierarchy  This Package  Previous  Next  Index