Class InstrumentedTileCache

java.lang.Object
nz.org.riskscape.engine.jai.InstrumentedTileCache
All Implemented Interfaces:
javax.media.jai.TileCache

public class InstrumentedTileCache extends Object implements javax.media.jai.TileCache

A decorator implementation of TileCache that logs cache hit/miss statistics for performance monitoring.

See Also:
  • TileCache
  • JAI
  • Constructor Details

    • InstrumentedTileCache

      public InstrumentedTileCache(javax.media.jai.TileCache tileCache, com.codahale.metrics.MetricRegistry metricRegistry)
  • Method Details

    • getTile

      public Raster getTile(RenderedImage owner, int tileX, int tileY)
      Specified by:
      getTile in interface javax.media.jai.TileCache
    • add

      public void add(RenderedImage owner, int tileX, int tileY, Raster data)
      Specified by:
      add in interface javax.media.jai.TileCache
    • add

      public void add(RenderedImage owner, int tileX, int tileY, Raster data, Object tileCacheMetric)
      Specified by:
      add in interface javax.media.jai.TileCache
    • addTiles

      public void addTiles(RenderedImage owner, Point[] tileIndices, Raster[] tiles, Object tileCacheMetric)
      Specified by:
      addTiles in interface javax.media.jai.TileCache
    • remove

      public void remove(RenderedImage owner, int tileX, int tileY)
      Specified by:
      remove in interface javax.media.jai.TileCache
    • removeTiles

      public void removeTiles(RenderedImage owner)
      Specified by:
      removeTiles in interface javax.media.jai.TileCache
    • flush

      public void flush()
      Specified by:
      flush in interface javax.media.jai.TileCache
    • getMemoryCapacity

      public long getMemoryCapacity()
      Specified by:
      getMemoryCapacity in interface javax.media.jai.TileCache
    • setMemoryCapacity

      public void setMemoryCapacity(long memoryCapacity)
      Specified by:
      setMemoryCapacity in interface javax.media.jai.TileCache
    • getTileCapacity

      public int getTileCapacity()
      Specified by:
      getTileCapacity in interface javax.media.jai.TileCache
    • setTileCapacity

      public void setTileCapacity(int tileCapacity)
      Specified by:
      setTileCapacity in interface javax.media.jai.TileCache
    • getMemoryThreshold

      public float getMemoryThreshold()
      Specified by:
      getMemoryThreshold in interface javax.media.jai.TileCache
    • setMemoryThreshold

      public void setMemoryThreshold(float threshold)
      Specified by:
      setMemoryThreshold in interface javax.media.jai.TileCache
    • getTileComparator

      public Comparator getTileComparator()
      Specified by:
      getTileComparator in interface javax.media.jai.TileCache
    • setTileComparator

      public void setTileComparator(Comparator comparator)
      Specified by:
      setTileComparator in interface javax.media.jai.TileCache
    • getTiles

      public Raster[] getTiles(RenderedImage owner)
      Specified by:
      getTiles in interface javax.media.jai.TileCache
    • getTiles

      public Raster[] getTiles(RenderedImage owner, Point[] tileIndices)
      Specified by:
      getTiles in interface javax.media.jai.TileCache
    • memoryControl

      public void memoryControl()
      Specified by:
      memoryControl in interface javax.media.jai.TileCache