|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.spy.SpyObject
net.spy.factory.GenFactory<T>
public abstract class GenFactory<T extends Instance>
Generic object instance cache.
| Constructor Summary | |
|---|---|
protected |
GenFactory(java.lang.String key,
long time)
Get an instance of GenFactory. |
| Method Summary | |
|---|---|
protected CacheEntry<T> |
getCache()
Get the cache for this factory. |
protected abstract java.util.Collection<T> |
getInstances()
Get the collection of all Instance objects to be cached. |
protected CacheEntry<T> |
getNewCacheEntry()
Get a CacheEntry instance to be populated with a collection of Instance objects. |
T |
getObject(int id)
Get an object by ID. |
java.util.Collection<T> |
getObjects()
Get all objects cached by this factory. |
protected T |
handleNullLookup(int id)
This method is called whenever getObject would return null. |
void |
recache()
Reset the cache for this factory. |
| Methods inherited from class net.spy.SpyObject |
|---|
getLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected GenFactory(java.lang.String key,
long time)
key - the cache key to usetime - the refresh duration of the cache| Method Detail |
|---|
protected CacheEntry<T> getCache()
protected CacheEntry<T> getNewCacheEntry()
protected abstract java.util.Collection<T> getInstances()
protected T handleNullLookup(int id)
id - the ID of the object that was requested.
public T getObject(int id)
id - the object ID
public java.util.Collection<T> getObjects()
public void recache()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||