|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.core.cache.AbstractResource<T>
T
- the resource type.public abstract class AbstractResource<T>
An abstract implementation of Resource.
Constructor Summary | |
---|---|
AbstractResource(String name,
T src)
Constructs a new resource. |
Method Summary | |
---|---|
boolean |
equals(Object other)
|
long |
getCheckInterval()
Gets the interval of checking validity of the resource. |
long |
getLastModified()
Gets the resource modification time. |
protected abstract long |
getModified()
Gets the resource modification time. |
String |
getName()
Gets the name of the resource. |
String |
getPath()
Gets the path of the resource. |
int |
getSizeLimit()
Gets the size limit for a cached resource. |
T |
getSource()
Gets the source of the resource. |
String |
getVersionTag()
Gets the version tag of the resource. |
int |
hashCode()
|
boolean |
isDeleteOnRelease()
Checks whether the resource source should be deleted on release. |
boolean |
isExpireAfterAccess()
Checks whether the resource should be expired after it has been accessed. |
void |
setCheckInterval(long msecs)
Sets the interval of checking validity of the resource. |
void |
setDeleteOnRelease(boolean flag)
Sets whether the resource source should be deleted on release. |
void |
setExpireAfterAccess(boolean flag)
Sets whether the resource should be expired after it has been accessed. |
void |
setPath(String path)
Sets the path of the resource. |
void |
setSizeLimit(int limit)
Sets a size limit for a resource. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.norther.tammi.core.cache.Resource |
---|
getInputStream, getLength, isValid, release |
Constructor Detail |
---|
public AbstractResource(String name, T src)
name
- the name.src
- the source.Method Detail |
---|
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String getName()
Resource
getName
in interface Resource<T>
public String getPath()
Resource
getPath
in interface Resource<T>
public void setPath(String path)
Resource
setPath
in interface Resource<T>
path
- the path of the resource.public T getSource()
Resource
getSource
in interface Resource<T>
public String getVersionTag()
Resource
getVersionTag
in interface Resource<T>
public long getLastModified()
Resource
getLastModified
in interface Resource<T>
public long getCheckInterval()
Resource
getCheckInterval
in interface Resource<T>
public void setCheckInterval(long msecs)
Resource
setCheckInterval
in interface Resource<T>
msecs
- the check interval in milliseconds (-1 = only once).public boolean isExpireAfterAccess()
Resource
isExpireAfterAccess
in interface Resource<T>
public void setExpireAfterAccess(boolean flag)
Resource
setExpireAfterAccess
in interface Resource<T>
flag
- true if to be expired, false otherwise.public boolean isDeleteOnRelease()
Resource
isDeleteOnRelease
in interface Resource<T>
public void setDeleteOnRelease(boolean flag)
Resource
setDeleteOnRelease
in interface Resource<T>
flag
- true if to be deleted, false otherwise.public int getSizeLimit()
Resource
getSizeLimit
in interface Resource<T>
public void setSizeLimit(int limit)
Resource
setSizeLimit
in interface Resource<T>
limit
- a limit for a resource size in bytes (-1 = unlimited).protected abstract long getModified()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |