|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
scone.netobjects.NetNodeCache
public class NetNodeCache
Caches all NetNode objects.
Use the static methods provided by this class to obtain NetNode objects.
Field Summary | |
---|---|
protected static CacheTable |
cache
key1=id key2=uri |
protected java.util.Vector |
items
|
static java.lang.Object |
lock
used to synchronize this cache |
protected static NetNodeCache |
observable
|
protected static int |
observePeriod
|
Method Summary | |
---|---|
protected void |
addItem(java.lang.Object o)
|
static void |
clean()
stores the cached NetNodes and removes empty entries from the cache. |
static NetNode |
get(NetNode base,
java.lang.String link)
get/create a NetNode by NetNodebase and link |
static NetNode |
get(SimpleUri sUri)
get/create a NetNode by SimpleUri NetNodes are stored only on demand or if cache cleaer (@link{CacheTable}) is running. |
static NetNode |
get(SimpleUri sUri,
boolean persistent)
get/create a NetNode by SimpleUri |
static NetNode |
get(java.lang.String uriString)
get/create a NetNode by plain String |
static NetNode |
get(java.lang.String id,
boolean persistent)
returns the NetNode stored in the database under the specified id. |
static NetNode |
getById(java.lang.String id)
returns the NetNode stored in the database under the specified id. |
static int |
getNetNodeCount(java.lang.String sqlClause)
This method returns a number of NetNodes to a given query string. |
static int |
getNetNodeCount(java.lang.String tables,
java.lang.String sqlClause)
This method returns a number of NetNodes to a given query string. |
static java.util.Vector |
getNetNodes(java.lang.String sqlClause)
This method returns a Vector of NetNodes to a given query string |
static int |
getObservePeriod()
returns how long the cache waits until it notifies Observers about new events |
static void |
init(int timeTillCleanUp,
int gcType)
Create a new cache for NetNodes. |
void |
notifyObservers()
|
static void |
putObserver(java.util.Observer o)
adds an Observer to the NetNodeCache class. |
static void |
removeObserver(java.util.Observer o)
removes an Observer from the NetNodeCache class. |
static void |
setObservePeriod(int period)
sets how long the cache waits until it notifies Observers about new events |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static NetNodeCache observable
protected static int observePeriod
protected static CacheTable cache
public static java.lang.Object lock
protected java.util.Vector items
Method Detail |
---|
public static void init(int timeTillCleanUp, int gcType)
timeTillCleanUp
- Interval to store objects from cache to databasegcType
- Garbage collector type: LAZYGC or EAGERGC. See CacheTable.javapublic static void setObservePeriod(int period)
period
- the period in milisecondspublic static int getObservePeriod()
public static void putObserver(java.util.Observer o)
o
- the Observerpublic static void removeObserver(java.util.Observer o)
o
- the Observerpublic static NetNode get(java.lang.String uriString)
uriString
- the String representation of the URI of the nodepublic static NetNode get(NetNode base, java.lang.String link)
base
- the NetNode of the present pagelink
- the String declared by the linkpublic static NetNode get(SimpleUri sUri)
If the netNode shall be made persistent immediately, call get(SimpleUri, true).
If new NetNodes shall not be made persistent, call get(SimpleUri, false).
To explicitly change the state of a NetNode call @link{TableRecord#setPersistent}
sUri
- the URIpublic static NetNode get(SimpleUri sUri, boolean persistent)
sUri
- the URIpersistent
- shall the NetNode be made persistent? public static NetNode getById(java.lang.String id)
id
- the id
public static NetNode get(java.lang.String id, boolean persistent)
sUri
- the URIpersistent
- shall the NetNode be made persistent? public static java.util.Vector getNetNodes(java.lang.String sqlClause)
sqlClause
- The where clause for the query string.public static int getNetNodeCount(java.lang.String tables, java.lang.String sqlClause)
tables
- The table names.sqlClause
- The where clause for the query string.
public static int getNetNodeCount(java.lang.String sqlClause)
sqlClause
- The where clause for the query string.
public static void clean()
protected void addItem(java.lang.Object o)
public void notifyObservers()
notifyObservers
in class java.util.Observable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |