deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.io.ecwapi
Class ECWFileCache

java.lang.Object
  extended by org.deegree.io.ecwapi.ECWFileCache

public class ECWFileCache
extends java.lang.Object

Since:
2.0
Version:
$Revision: 10660 $, 1.0. $Revision: 10660 $, $Date: 2008-03-24 22:39:54 +0100 (Mo, 24 Mär 2008) $
Author:
Jens Stutte, last edited by: $Author: apoth $

Field Summary
static long EXPIRATION_PERIOD_MS
           
static long MAX_NUM_OPEN
           
 
Constructor Summary
ECWFileCache()
           
 
Method Summary
static com.ermapper.ecw.JNCSFile claimAccess(java.lang.String fileName)
          Claim access to an ECW file.
static void releaseFile(com.ermapper.ecw.JNCSFile myfile)
          Release access to an ECW file.
static void setExpirationPeriod(long MilliSecs)
          Set expiration period Set the time in milliseconds that a cache entry remains valid.
static void setMaxNumOpen(long MaxOpen)
          Set maximum number of unused file instances This parameter describes the maximum number of UNLOCKED entries in the cache (locked instances are not counted).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPIRATION_PERIOD_MS

public static long EXPIRATION_PERIOD_MS

MAX_NUM_OPEN

public static long MAX_NUM_OPEN
Constructor Detail

ECWFileCache

public ECWFileCache()
Method Detail

claimAccess

public static com.ermapper.ecw.JNCSFile claimAccess(java.lang.String fileName)
                                             throws com.ermapper.ecw.JNCSException
Claim access to an ECW file.

If there is a non-expired instance in the cache, re-uses and locks this. Otherwise adds a new one to the cache.

CAUTION: This cache DOES NOT HANDLE NESTED LOCKS/UNLOCKS ! This means, that after having called claimAcces, you MUST call releaseFile before ANY OTHER OPERATION ON THE CACHE within the same thread.

NOTE: There is no periodical cleanup of this cache. The expiration method is called only during new calls to claimAccess/releaseFile. So server memory consumption may remain high for a much longer time than the defined ExpirationPeriod.

Throws:
com.ermapper.ecw.JNCSException

releaseFile

public static void releaseFile(com.ermapper.ecw.JNCSFile myfile)
Release access to an ECW file.

Unlocks the cache entry. Calls also the expiration method for cleanup of the instances that exceed MaxNumOpen.


setExpirationPeriod

public static void setExpirationPeriod(long MilliSecs)
Set expiration period

Set the time in milliseconds that a cache entry remains valid. Calls also the expiration method for cleanup.

Default value: 600000


setMaxNumOpen

public static void setMaxNumOpen(long MaxOpen)
Set maximum number of unused file instances

This parameter describes the maximum number of UNLOCKED entries in the cache (locked instances are not counted). Calls also the expiration method for cleanup.

Default value: 10


deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org