|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class represents an execution environment for XAPE application processing. It provides useful methods to access data and functions of the Engine. An environment is instanciated for each application instance.
Method Summary | |
void |
addXPathVariable(java.lang.String name,
java.lang.Object value)
Adds an new XPath variable. |
com.virtualweaver.xotics.datamodel.XoDMInstance |
bindDmdl(java.lang.String sharespace,
java.lang.String docName,
java.lang.String nsref,
boolean force)
Loads the DMDL document for a specific namespace nsref into
a specific share space or in the private space. |
com.virtualweaver.xotics.datamodel.XoDMInstance |
bindDocument(java.lang.String sharespace,
java.lang.String docName,
java.net.URL url,
java.util.Map initOptions,
java.lang.Object initObject,
boolean force)
loads a document into a specific share space or in the private space. |
com.virtualweaver.xotics.datamodel.XoDMInstance |
bindDocument(java.lang.String sharespace,
java.lang.String docName,
com.virtualweaver.xotics.datamodel.XoDMInstance doc,
java.util.HashMap initOptions,
java.lang.Object initObject,
boolean force)
loads a document into a specific share space or in the private space. |
java.lang.Object |
clone()
|
com.virtualweaver.xotics.datamodel.XoDMInstance |
createDocument(java.lang.String sharespace,
java.lang.String docName,
java.lang.String nsref,
java.lang.String prefix,
java.lang.String element,
java.util.Map initOptions,
java.lang.Object initObject,
boolean force)
Creates a document into a specific share space or in the private space. |
void |
debug(java.lang.String id,
java.lang.String element,
java.lang.String message)
|
java.lang.String |
getApplicationName()
Accessor for the current application name |
java.lang.String[] |
getApplicationNames()
Return the name of each application loaded by the Engine |
java.net.URL |
getBaseUrl()
Accessor for specified base URL, if any. |
java.lang.String |
getCurrentState()
Accessor for the current state |
com.virtualweaver.xotics.datamodel.XoDMInstance |
getDocument(java.lang.String sharespace,
java.lang.String docName)
Returns the XO DM instance for XML document named docName
in the share space sharespace . |
com.virtualweaver.xotics.datamodel.XoDMInstance |
getDocument(XapDocumentId did)
Returns the XO DM instance for XML document designated by did . |
XapDocumentId[] |
getDocumentNames()
Returns the full list of documents accessible to XAPE instance using this. |
java.lang.String |
getInstanceName()
Accessor for the current instance name. |
java.lang.String[] |
getInstanceNames(java.lang.String appName)
Returns the list of instances of application named appName currently
running. |
java.lang.String |
getNextState()
Accessor for the next state, which will become the current state at next iteration. |
java.lang.String[] |
getShareSpaceNames()
Returns the full list of existing share spaces. |
com.virtualweaver.xotics.datamodel.XoEnvironment |
getXoEnvironment()
Accessor to the current XO environment |
com.virtualweaver.xotics.datamodel.XoNode |
getXPathContextNode()
This runtime environment can compute XPath requests, and stores at any time a context node. |
java.util.Map |
getXPathVariables()
Returns XPath variables currently stored by this, and used in every XPath request computed by this. |
boolean |
isMultiInstances(java.lang.String appName)
Tells whether this application is multi instances or not |
void |
log(java.lang.String id,
java.lang.String element,
java.lang.String message)
|
void |
reloadApplication(java.lang.String name)
Ask Engine to update a XAPE application (named name ) at run-time, by reloading
its main application document. |
void |
removeXPathVariable(java.lang.String name)
Removes XPath variable identified by param name form the list of stored variables. |
java.net.URL |
resolveUrl(java.lang.String url)
From a string param url representing a relative or absolute URL, returns an absolute URL. |
java.lang.String |
resolveValue(java.lang.String val)
In any XAP application arguments of type string, a string can contain XPath request parts enclosed by '{}' which are resolved by this method into strings. |
XapResponse |
sendRequest(XapRequest req)
Sends a request to be processed by the Engine. |
void |
setNextState(java.lang.String state)
Sets the next state. |
void |
setXPathContextNode(com.virtualweaver.xotics.datamodel.XoNode node)
Sets the current XPath context node, used in every XPath request computed by this. |
void |
unbindDocument(java.lang.String sharespace,
java.lang.String docName,
boolean release)
Removes the document named docName either from a specific share space
identified by sharespace or from the private space. |
com.virtualweaver.xotics.datamodel.XoDataType |
xpathRequest(java.lang.String req)
Computes an XPath request defined by param req. |
com.virtualweaver.xotics.datamodel.XoNode[] |
xpathRequestNodes(java.lang.String req)
The same method as xpathRequest() excepted that result is filtered to show
XoNode objects only. |
Method Detail |
public com.virtualweaver.xotics.datamodel.XoEnvironment getXoEnvironment()
public java.lang.String getInstanceName()
public void reloadApplication(java.lang.String name) throws XapException
name
) at run-time, by reloading
its main application document.
name
- name of the application to update
XapException
public java.lang.String getApplicationName()
public java.lang.String[] getApplicationNames() throws XapException
XapException
public boolean isMultiInstances(java.lang.String appName) throws XapException
appName
- name of an application
XapException
public java.net.URL getBaseUrl()
public java.net.URL resolveUrl(java.lang.String url) throws XapException
url
- a relative or absolute url string
XapException
- if some error occurs during resolutionpublic java.lang.String getCurrentState()
public java.lang.String getNextState()
public void setNextState(java.lang.String state)
state
- the state to jumpt to at next iterationpublic com.virtualweaver.xotics.datamodel.XoNode getXPathContextNode()
public void setXPathContextNode(com.virtualweaver.xotics.datamodel.XoNode node)
node
- any XO object implementing XoNode (XoDMInstance, XoObject, XoProperty)public java.util.Map getXPathVariables()
public void addXPathVariable(java.lang.String name, java.lang.Object value)
name
- variable namevalue
- variable valuepublic void removeXPathVariable(java.lang.String name)
name
- name of the variable to removepublic com.virtualweaver.xotics.datamodel.XoDMInstance getDocument(java.lang.String sharespace, java.lang.String docName) throws XapException
docName
in the share space sharespace
. To get documents in the private space,
set param sharespace
to null.
sharespace
- a share space name or null to get documents of private spacedocName
- the document name
XapException
- for any error occurrencepublic com.virtualweaver.xotics.datamodel.XoDMInstance getDocument(XapDocumentId did) throws XapException
did
.
did
- the document full ID (sharespace + name)
XapException
- for any error occurrencepublic XapDocumentId[] getDocumentNames() throws XapException
XapException
- for any error occurrencepublic java.lang.String[] getShareSpaceNames() throws XapException
XapException
- for any error occurrencepublic XapResponse sendRequest(XapRequest req) throws XapException
req
- a request to send
XapException
- for any error occurrencepublic java.lang.String[] getInstanceNames(java.lang.String appName) throws XapException
appName
currently
running.
appName
- application name
XapException
public com.virtualweaver.xotics.datamodel.XoDMInstance bindDocument(java.lang.String sharespace, java.lang.String docName, java.net.URL url, java.util.Map initOptions, java.lang.Object initObject, boolean force) throws XapException
sharespace
- a share space container or null to refer to the private spacedocName
- name of the document to loadurl
- location of the XML document to loadinitOptions
- optional map containing init options for XO loading (XoFactory.loadDMInstance())initObject
- optional object specific to the document loading processforce
- when true, replaces any document already bound with same (sharespace, docName) ID,
otherwise an exception is thrown in such case
XapException
- if loading fails or if a document is already bound with same (sharespace, docName) IDpublic com.virtualweaver.xotics.datamodel.XoDMInstance bindDocument(java.lang.String sharespace, java.lang.String docName, com.virtualweaver.xotics.datamodel.XoDMInstance doc, java.util.HashMap initOptions, java.lang.Object initObject, boolean force) throws XapException
sharespace
- a share space container or null to refer to the private spacedocName
- name of the document to loaddoc
- DM instance to bind to current InstanceinitOptions
- optional map containing init options for XO loading (XoFactory.loadDMInstance())initObject
- optional object specific to the document loading processforce
- when true, replaces any document already bound with same (sharespace, docName) ID,
otherwise an exception is thrown in such case
XapException
- if loading fails or if a document is already bound with same (sharespace, docName) IDpublic com.virtualweaver.xotics.datamodel.XoDMInstance bindDmdl(java.lang.String sharespace, java.lang.String docName, java.lang.String nsref, boolean force) throws XapException
nsref
into
a specific share space or in the private space.
sharespace
- a share space container or null to refer to the private spacedocName
- name of the document to loadnsref
- namespace of the dialect whose DMDL document is to loadforce
- when true, replaces any document already bound with same (sharespace, docName) ID,
otherwise an exception is thrown in such case
XapException
- if loading fails or if a document is already bound with same (sharespace, docName) IDpublic com.virtualweaver.xotics.datamodel.XoDMInstance createDocument(java.lang.String sharespace, java.lang.String docName, java.lang.String nsref, java.lang.String prefix, java.lang.String element, java.util.Map initOptions, java.lang.Object initObject, boolean force) throws XapException
sharespace
- a share space container or null to refer to the private space.docName
- name of the document to creatensref
- namespace of the root elementprefix
- NS prefix for root elementelement
- root element nameinitOptions
- optional map containing init options for XO creating (XoFactory.createDMInstance())initObject
- optional object specific to the document creating processforce
- when true, replaces any document already bound with same (sharespace, docName) ID,
otherwise an exception is thrown in such case
XapException
- if creation process fails or if a document is already bound with same (sharespace, docName) IDpublic void unbindDocument(java.lang.String sharespace, java.lang.String docName, boolean release) throws XapException
docName
either from a specific share space
identified by sharespace
or from the private space.
sharespace
- share space of the document to remove ; a null avalue identifies
the private spacedocName
- the document namerelease
- if true, a call to XoDMInstance.release() is performed after removal
XapException
- if remove operation failspublic com.virtualweaver.xotics.datamodel.XoDataType xpathRequest(java.lang.String req) throws XapException
doc()
which specify the target document for the request.
These formats are allowed : doc(sharespace#docname)
or doc(docname)
. Missing sharespace
means private space. Missing
doc()
function identifies the application document where the request is written.
req
- the XPath request
XapException
- on any XPath request errorpublic com.virtualweaver.xotics.datamodel.XoNode[] xpathRequestNodes(java.lang.String req) throws XapException
xpathRequest()
excepted that result is filtered to show
XoNode objects only. It's a utility method to retreive nodes.
req
- the XPath request
XapException
- on any XPath request errorpublic java.lang.String resolveValue(java.lang.String val) throws XapException
"this is a {doc(doc1)//process[1]/@val} string"
If @val is "dynamic", the initial string becomes once resolved :
"this is a dynamic string". Unresolved parts are left as is.
val
- the string to resolve
XapException
- on any XPath request errorpublic void debug(java.lang.String id, java.lang.String element, java.lang.String message)
public void log(java.lang.String id, java.lang.String element, java.lang.String message)
public java.lang.Object clone()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |