|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.shark.caching.SimpleResourceCache
public class SimpleResourceCache
This class is simple (HashMap) cache for storing resources.
Field Summary | |
---|---|
protected java.util.HashMap |
cache
HashMap process cache. |
Constructor Summary | |
---|---|
SimpleResourceCache()
|
Method Summary | |
---|---|
void |
add(java.lang.String username,
WfResourceInternal res)
Adds resource to the resource cache. |
void |
configure(CallbackUtilities cus)
Configures resource cache. |
WfResourceInternal |
get(java.lang.String username)
Returns the resource from the resource cache with username username. |
java.util.List |
getAll()
Returns all resources from the resource cache. |
int |
getSize()
Returns the size of the resource cache. |
int |
howManyEntries()
|
void |
remove(java.lang.String username)
Removes resource from the resource cache. |
void |
setSize(int size)
Sets size of the resource cache to value size. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.HashMap cache
Constructor Detail |
---|
public SimpleResourceCache()
Method Detail |
---|
public void configure(CallbackUtilities cus) throws java.lang.Exception
configure
in interface ObjectCache
cus
- an instance of CallbackUtilities used to get
properties for configuring resource cache.
java.lang.Exception
- Thrown if an error occurs.public void add(java.lang.String username, WfResourceInternal res) throws java.lang.Exception
add
in interface ResourceCache
username
- Username of the resource.res
- WfResourceInternal object to be added to the resource cache.
java.lang.Exception
- Thrown if an error occurs.public void remove(java.lang.String username) throws java.lang.Exception
remove
in interface ResourceCache
username
- Username of the resource.
java.lang.Exception
- Thrown if an error occurs.public WfResourceInternal get(java.lang.String username) throws java.lang.Exception
get
in interface ResourceCache
username
- Username of the resource.
java.lang.Exception
- Thrown if an error occurs.public java.util.List getAll() throws java.lang.Exception
getAll
in interface ObjectCache
java.lang.Exception
- Thrown if an error occurs.public void setSize(int size) throws java.lang.Exception
setSize
in interface ObjectCache
size
- New size of the resource cache.
java.lang.Exception
- Thrown if an error occurs.public int getSize() throws java.lang.Exception
getSize
in interface ObjectCache
java.lang.Exception
- Thrown if an error occurs.public int howManyEntries() throws java.lang.Exception
howManyEntries
in interface ObjectCache
java.lang.Exception
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |