|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IConfCache
Interface for the configuration object cache.
Method Summary | ||
---|---|---|
void |
add(ICfgObject obj)
Adds a new configuration object to the cache. |
|
java.util.concurrent.Future<IConfCache> |
beginRefresh(AsyncInvoker asyncInvoker,
Action<java.util.concurrent.Future<IConfCache>> finishCallback)
Asynchronously updates all configuration objects in the cache. |
|
void |
clear()
Removes all cache contents. |
|
boolean |
contains(ICfgObject obj)
Determines whether the cache contains the specified object. |
|
void |
deserialize(javax.xml.transform.Source source)
Deserializes the cache from the specified source. |
|
void |
endRefresh(java.util.concurrent.Future<IConfCache> asyncResult)
To be called when the asynchronous refresh operation is complete. |
|
IConfCachePolicy |
getPolicy()
Returns the current policy associated with this cache. |
|
void |
refresh()
Synchronously updates all configuration objects which are currently in the cache. |
|
void |
remove(CfgObjectType type,
int dbid)
Removes the configuration object with the specified type and dbid from the cache. |
|
void |
remove(ICfgObject obj)
Removes the specified configuration object from the cache. |
|
|
retrieve(java.lang.Class<T> cls,
CfgObjectType type,
int dbid)
Retrieves a configuration object from the cache. |
|
|
retrieve(java.lang.Class<T> cls,
ICfgQuery query)
Retrieves a configuration object from the cache. |
|
|
retrieveMultiple(java.lang.Class<T> cls)
Retrieves an enumerable list of objects from the cache. |
|
|
retrieveMultiple(java.lang.Class<T> cls,
ICfgQuery query)
Retrieves an enumerable list of objects from the cache. |
|
void |
serialize(javax.xml.transform.Result result)
Serializes the cache to the specified result. |
|
void |
update(ICfgObject obj)
Overwrites a configuration object which already exists in the cache with a new copy. |
Methods inherited from interface com.genesyslab.platform.applicationblocks.commons.broker.Subscriber |
---|
getFilter |
Methods inherited from interface com.genesyslab.platform.applicationblocks.commons.Action |
---|
handle |
Method Detail |
---|
void add(ICfgObject obj)
obj
- A configuration objectvoid update(ICfgObject obj)
obj
- A configuration objectvoid remove(ICfgObject obj)
obj
- A configuration objectvoid remove(CfgObjectType type, int dbid)
type
- The type of configuration objectdbid
- The dbid of the configuration objectvoid clear()
<T extends ICfgObject> T retrieve(java.lang.Class<T> cls, CfgObjectType type, int dbid)
T
- The type of configuration object that should be returnedcls
- class of object to be retrievedtype
- The type of configuration objectdbid
- The dbid of the configuration object
<T extends ICfgObject> T retrieve(java.lang.Class<T> cls, ICfgQuery query)
T
- The type of configuration object that should be returnedcls
- class of object to be retrievedquery
- A query based on which the result is obtained
<T extends ICfgObject> java.lang.Iterable<T> retrieveMultiple(java.lang.Class<T> cls, ICfgQuery query)
T
- The types of configuration objects to be included in the list.cls
- class of objects to be retrievedquery
- A query based on which the result is obtained
<T extends ICfgObject> java.lang.Iterable<T> retrieveMultiple(java.lang.Class<T> cls)
T
- The types of configuration objects to be included in the list.cls
- class of objects to be retrieved
boolean contains(ICfgObject obj)
obj
- The configuration object to look for
void serialize(javax.xml.transform.Result result)
result
- The result into which the cache is to be writtenStreamResult
,
DOMResult
void deserialize(javax.xml.transform.Source source)
source
- The source from which the cache is to be readStreamSource
,
DOMSource
void refresh() throws ConfigException, java.lang.InterruptedException
ConfigException
- is thrown in case of object(s) reload exception
java.lang.InterruptedException
- is thrown in case of working thread interruptedjava.util.concurrent.Future<IConfCache> beginRefresh(AsyncInvoker asyncInvoker, Action<java.util.concurrent.Future<IConfCache>> finishCallback)
AsyncInvoker invoker =
new SingleThreadInvoker("CacheAsyncRefresh");
Future asyncRefresh =
cache.beginRefresh(invoker, null);
// DO SOMETHING...
// To check that refresh is done:
if (asyncRefresh.isDone()) {
// ...
}
// To wait for refresh is done:
asyncRefresh.get();
// After refresh is done and invoker is not needed:
invoker.dispose();
asyncInvoker
- invoker for refresh task executionfinishCallback
- The callback method to be invoked when the operation completes
void endRefresh(java.util.concurrent.Future<IConfCache> asyncResult)
asyncResult
- The async result associated with the current operationIConfCachePolicy getPolicy()
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |