subject - Cache.CHANGE
id or ids - the ID or array of IDs of the modified documentsaction - Cache.ADD, Cache.CHANGE or Cache.REMOVE
subject - the cache ID of the modified documentaction - Cache.ADD, Cache.CHANGE or Cache.REMOVE
getOrOpenAsync() method. This method returns
the corresponding document synchronously if it already exists in the cache. If the document does not exist in the
cache, then it is loaded asynchronously and the method returns a placeholder document. The namespace URI of this
placeholder document is Cache.XSDNS and its root node name is "loading".
Since the cache stores this placeholder document until the document finishes loading, subsequent calls to
synchronous APIs (getDocument(), getOrOpenDocument(), etc) may also return the
placeholder document. It is therefore important to check the namespace of the returned document when any code
uses the asynchronous APIs.
Once a document finishes loading asynchronously the placeholder document is replaced with the loaded document.
This change in value causes the cache to publish a pair of events of action Cache.CHANGE. If
loading the document fails or times out the placeholder document is instead replaced with another placeholder
document. This document also has a URI namespace of Cache.XSDNS. Its root node name may be either
"error" or "timeout". If the root node name is "error" then the root node
has an attribute, also named "error", which contains the XML error message.
| Field Summary | |
|---|---|
| static String | Event action. |
| static int | The number of milliseconds before asynchronous document loads time out. |
| static String | Event subject and action. |
| static String | Event action. |
| static String | |
| Constructor Summary | |
|---|---|
| void | init() Creates a new instance of this class. |
| Method Summary | |
|---|---|
| jsx3.xml.Document | Removes the document stored in this cache under id strId. |
| Array<String> | clearByTimestamp(intTimestamp : int | Date) Removes all documents placed in this cache before intTimestamp. |
| void | destroy() Removes all references to documents contained in this cache. |
| jsx3.xml.Document | getDocument(strId : String) Returns the document stored in this cache under id strId. |
| jsx3.xml.Document | Asynchronously loads an xml document and stores it in this cache. |
| jsx3.xml.Document | Retrieves a document from this cache or, if this cache contains no such document, loads the document
synchronously and returns it. |
| int | getTimestamp(strId : String) Returns the timestamp from when the document stored under id strId was stored in this cache. |
| boolean | Deprecated. |
| Array<String> | keys() Returns a list of all the keys in this cache instance. |
| jsx3.xml.Document | Synchronously loads an xml document, stores it in this cache, and returns the loaded document. |
| void | Stores the document objDocument in this cache under id strId. |
| Methods Inherited From jsx3.util.EventDispatcher |
|---|
| publish, subscribe, unsubscribe, unsubscribeAll |
| Methods Inherited From jsx3.lang.Object |
|---|
| clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf, toString |
| Field Detail |
|---|
| Constructor Detail |
|---|
| Method Detail |
|---|
strId.intTimestamp.strId.null if none exists.
strURL parameter is used as the id.jsx3.xml.Document (default value) or one of its subclasses. The
class with which to instantiate the new document instance.strURL parameter is used as the id.jsx3.xml.Document (default value) or one of its subclasses. The
class with which to instantiate the new document instance if a new document is opened.strId was stored in this cache.null if no such document exists
in this cache.
false. strURL parameter is used as the id.jsx3.xml.Document (default value) or one of its subclasses. The
class with which to instantiate the new document instance.objDocument in this cache under id strId. If a document already
exists in this cache under strId then that document is removed from the cache.objDocument.