|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.gee.publication.net.Cache
public class Cache
Caching of ZPad specific files.
| Field Summary | |
|---|---|
protected static Hashtable |
_globalCache
The world wide collection of ZPad files. |
protected static Hashtable |
_globalSyncObjects
The table contains WURL <--> _localSyncObjects pairs. |
protected Vector |
_listeners
A list of listeners |
protected Hashtable |
_localCache
The cache object for this location. |
protected Hashtable |
_localSyncObjects
The sync objects for this location. |
WURL |
_location
The location of the files handled by this cache |
protected static Vector |
_peers
A pool of active cache objects |
| Constructor Summary | |
|---|---|
Cache(WURL location,
int maxSize)
Creates a new cache object. |
|
| Method Summary | |
|---|---|
protected void |
_notify(WURL location,
int info,
String filename,
Object arg)
Notify this cache object of an update in the cache done by another cache object. |
protected static void |
_refresh(Hashtable localCache)
... |
protected static void |
_remove(Hashtable localCache,
String filename)
|
void |
addListener(IOListener listener)
Add a listener to the audience. |
void |
close()
Nicely deregister the cache, thus cleaning up any unnecessary peer registration to enable garbage collect. |
boolean |
contains(String filename)
Checks whether a specific file is cached. |
Object |
get(String filename)
Gets an object from the cache. |
Object |
get(String filename,
WURL url)
Gets an object from the cache: only used by the OutputHandler for processing jobs in the Q. |
Vector |
getAll()
Gets all objects from the cache. |
Object |
getSynchronizationObject(Object name)
|
void |
notifyAll(int info,
String filename,
Object arg)
Notify all Cache peers of a change of an object at this Cache's location identified by a name. |
void |
put(String filename,
Object object)
Puts an object in the cache. |
void |
refresh()
Forget EVERYTHING about the current location. |
static void |
refresh(String host)
Be very careful .... |
static void |
refreshAtMidnight()
Removing *everything* at midnight is expensive and unnecessary. |
void |
remove(String filename)
Remove a file from the cache. |
void |
removeListener(IOListener listener)
Remove a listener from the audience. |
void |
stayForever()
This ZPad cache will live on forever, even though nobody listens to it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Vector _peers
protected static Hashtable _globalCache
protected Hashtable _localCache
protected Vector _listeners
public WURL _location
protected static Hashtable _globalSyncObjects
protected Hashtable _localSyncObjects
| Constructor Detail |
|---|
public Cache(WURL location,
int maxSize)
location - the ZPad location to transfer from/to.maxSize - an upper bound for the number of files that
are cached without removing inactive files (not implemented yet).| Method Detail |
|---|
public void remove(String filename)
filename - the name of the file to remove.
protected static void _remove(Hashtable localCache,
String filename)
public boolean contains(String filename)
filename - the name of the file to look for.
public Object get(String filename)
filename - the name of the file to look for.
public Vector getAll()
public Object get(String filename,
WURL url)
filename - the name of the file to look for.url - the location of the file.
public void put(String filename,
Object object)
filename - the filename under which the object will be
stored.object - the object to put in the cache.
public void notifyAll(int info,
String filename,
Object arg)
info - the information to send.filename - the name of the object updated.arg - an optional argument.
protected void _notify(WURL location,
int info,
String filename,
Object arg)
location - the location of the cache update.info - the information to send.filename - the name of the object updated.arg - an optional argument.public void addListener(IOListener listener)
listener - a new I/O listener.public void removeListener(IOListener listener)
listener - the listener to remove.public void close()
public void stayForever()
protected static void _refresh(Hashtable localCache)
public static void refresh(String host)
public void refresh()
public static void refreshAtMidnight()
public Object getSynchronizationObject(Object name)
name - an identification of the file and operation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||