wal
Class CacheServiceImpl

java.lang.Object
wal.CacheServiceImpl
- All Implemented Interfaces:
- CacheService, FileStateListener
- public class CacheServiceImpl
- extends java.lang.Object
- implements CacheService
|
Constructor Summary |
CacheServiceImpl()
CacheServiceImpl use as cache dir user.dir/cache. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cru
private wal.net.ResourceUpdater cru
cachedir
private java.lang.String cachedir
- cache directory
files
private java.io.File[] files
- holds any files from cache directory
CacheServiceImpl
public CacheServiceImpl()
throws WALException
CacheServiceImpl use as cache dir user.dir/cache.
addResourceUpdater
public void addResourceUpdater(wal.net.ResourceUpdater ru)
- Description copied from interface:
CacheService
- Installs an ResourceUpdater which is responsible to keep cache
directory up to date.
- Specified by:
addResourceUpdater in interface CacheService
runClass
public void runClass(java.lang.String name,
java.lang.String[] args)
- Description copied from interface:
CacheService
- Invokes main class which is looked up from a jar file
within cache directory.
- Specified by:
runClass in interface CacheService
isResourceCached
public boolean isResourceCached(java.net.URL url,
java.lang.String version)
- Specified by:
isResourceCached in interface CacheService
removeResource
public void removeResource(java.net.URL url,
java.lang.String str)
throws java.io.IOException
- Specified by:
removeResource in interface CacheService
stateChanged
public void stateChanged(byte state,
java.lang.String url)
- Specified by:
stateChanged in interface CacheService
getFileHandle
public FileHandle getFileHandle(java.net.URL url)
throws java.io.IOException
- Description copied from interface:
CacheService
- Take a
FileHandle if you want cache a new resource.
It should be the only way for adding new resources to cache directory.
- Specified by:
getFileHandle in interface CacheService
initCache
private void initCache()
- Inspects the cache directory and collect all files.
initJNLP
private void initJNLP()
throws WALException
- Parse JNLP file and stores it results into
JNLPStore
extractFilename
private java.lang.String extractFilename(java.net.URL url)
- Returns file name based on parameter url
extractFilename
private java.lang.String extractFilename(java.lang.String url)
- Returns file name based on parameter url
getJarFilesIterator
private java.util.Iterator getJarFilesIterator()
- Returns a JarFile Iterator from Jar files found along
cache directory.