ilog.views.tiling
Class IlvDefaultTileCache

java.lang.Object
  extended by ilog.views.tiling.IlvTileCache
      extended by ilog.views.tiling.IlvDefaultTileCache
All Implemented Interfaces:
IlvPersistentObject

public class IlvDefaultTileCache
extends IlvTileCache

The default cache of the tile controllers. This cache maintains a list of cached tiles. The maximum size of this list can be specified.
When the size of the cache is exceeded and a new tile is about to be loaded, the least recently used cached tiles are released.

Since:
ILOG JViews 3.0

Constructor Summary
IlvDefaultTileCache()
          Creates an instance of the default cache.
IlvDefaultTileCache(IlvInputStream stream)
          Reads a cache from an IlvInputStream.
IlvDefaultTileCache(int size)
          Creates an instance of the default cache with the specified size.
 
Method Summary
 void controllerDisposed(IlvTileController controller)
          Removes the tiles of the specified controller from the internal structure of the cache.
 int getCacheSize()
          Returns the cache size.
static IlvDefaultTileCache GetDefaultCache()
          Returns a default cache instance that can be shared by several tile controllers.
 void setCacheSize(int size)
          Sets the cache size.
 void tileAboutToLoad(IlvTile tile)
          This method is called by a tile controller each time that a tile is about to be loaded.
 void tileCached(IlvTile tile)
          This method is called each time a loaded tile no longer has a lock.
 void tileRetrieved(IlvTile tile)
          This method is called each time that a cached tile is locked again.
 void write(IlvOutputStream stream)
          Writes the cache to an IlvOutputStream.
 
Methods inherited from class ilog.views.tiling.IlvTileCache
releaseTile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvDefaultTileCache

public IlvDefaultTileCache()
Creates an instance of the default cache.


IlvDefaultTileCache

public IlvDefaultTileCache(int size)
Creates an instance of the default cache with the specified size.

Parameters:
size - The default cache size

IlvDefaultTileCache

public IlvDefaultTileCache(IlvInputStream stream)
                    throws IlvReadFileException
Reads a cache from an IlvInputStream.

Parameters:
stream - The input stream
Throws:
IlvReadFileException - if an error occurs while reading.
Method Detail

GetDefaultCache

public static IlvDefaultTileCache GetDefaultCache()
Returns a default cache instance that can be shared by several tile controllers.


tileCached

public void tileCached(IlvTile tile)
This method is called each time a loaded tile no longer has a lock.

Specified by:
tileCached in class IlvTileCache
Parameters:
tile - The tile to be cached

tileRetrieved

public void tileRetrieved(IlvTile tile)
This method is called each time that a cached tile is locked again.

Specified by:
tileRetrieved in class IlvTileCache
Parameters:
tile - The tile that is retrieved from the cache by a tile controller

tileAboutToLoad

public void tileAboutToLoad(IlvTile tile)
This method is called by a tile controller each time that a tile is about to be loaded. The cache can then, if necessary, release tiles.

Specified by:
tileAboutToLoad in class IlvTileCache
Parameters:
tile - The tile that is about to be loaded

controllerDisposed

public void controllerDisposed(IlvTileController controller)
Removes the tiles of the specified controller from the internal structure of the cache.

Specified by:
controllerDisposed in class IlvTileCache

getCacheSize

public final int getCacheSize()
Returns the cache size.


setCacheSize

public void setCacheSize(int size)
Sets the cache size.


write

public void write(IlvOutputStream stream)
           throws IOException
Writes the cache to an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvTileCache
Parameters:
stream - the output stream
Throws:
IOException - thrown when an exception occurs during the write operation for this object.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.