|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.virtualweaver.xotics.dialect.xape.engine.XapEngine
This class is the XAP engine. though it can be used directly to be integrated
in any development, XapPlayer
should be preferred, as it adds XML config support.
Notice that any method of this can be called at any time.
XapPlayer
Constructor Summary | |
XapEngine(com.virtualweaver.xotics.datamodel.XoEnvironment env)
The engine is instanciated with an existing XO environment. |
Method Summary | |
void |
addShareSpace(java.lang.String spaceName)
Adds a share space. |
static XapRequest |
createRequest(com.virtualweaver.xotics.datamodel.XoEnvironment env,
byte type,
java.lang.String appName,
java.lang.String instanceName,
java.lang.String handler,
java.lang.String reqId,
XapQueue responseQueue,
com.virtualweaver.xotics.datamodel.XoObject contentObject)
This is a utility method to create a request object, root of an XML subtree dedicated to be integrated into the private context of an app instance. |
static XapRequest |
createShutdownMessage(com.virtualweaver.xotics.datamodel.XoEnvironment env,
java.lang.String appName,
java.lang.String instanceName)
Utility method to create a special message requesting the shutdown of a particular App instance. |
static XapRequest |
createStartupMessage(com.virtualweaver.xotics.datamodel.XoEnvironment env,
java.lang.String appName,
java.lang.String instanceName)
Creates a special message requesting the launch of a new Instance, named instanceName, from a loaded Application identified by appName. |
com.virtualweaver.xotics.datamodel.XoEnvironment |
getEnvironment()
Accessor to current XO environment. |
XapRepository |
getRepository()
Returns the repository, an object able to provide name of current applications, instances and share spaces. |
void |
loadApplication(com.virtualweaver.xotics.datamodel.XoDMInstance appDoc,
java.lang.String name,
java.util.Map parameters)
Loads an application, composed with an app document (XAPE APP dialect) and associated config parameters. |
XapResponse |
sendRequest(XapRequest req)
Sends a request. |
void |
setParameter(java.lang.String param,
java.lang.Object value)
Sets a config parameter. |
void |
shutdown()
Stops the engine. |
void |
startup()
Starts the engine. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XapEngine(com.virtualweaver.xotics.datamodel.XoEnvironment env) throws XapException
env
- an existing XO environment
XapException
- if some error occurs during dialect implementation loading processMethod Detail |
public com.virtualweaver.xotics.datamodel.XoEnvironment getEnvironment()
public void startup() throws XapException
XapException
- if some error occurs during startup processpublic XapRepository getRepository()
public void shutdown()
public void setParameter(java.lang.String param, java.lang.Object value) throws XapException
ECP_IDLE_TIME_BEFORE_END
ECP_MIN_PROCESSES
ECP_MAX_PROCESSES
XapConstants
param
- the name of the paramvalue
- corresponding value
XapException
- if invalid param name or value is providedXapConstants
public void addShareSpace(java.lang.String spaceName) throws XapException
spaceName
- name of the share space to create
XapException
- in case of invalid share space namepublic void loadApplication(com.virtualweaver.xotics.datamodel.XoDMInstance appDoc, java.lang.String name, java.util.Map parameters) throws XapException
ACP_MULTI_INSTANCES
ACP_AUTO_LAUNCH
ACP_EXEC_MODE
ACP_BASE_URL
ACP_START_VARIABLES
XapConstants
If param ACP_AUTO_LAUNCH
is provided, this appli is also started.
appDoc
- the XML document, in XAPE APP dialectname
- name of the application to loadparameters
- a map containing loading parameters, as couples of name/value
XapException
XapConstants
public XapResponse sendRequest(XapRequest req) throws XapException
req
- a request object containing target and content
XapException
XapRequest
public static XapRequest createShutdownMessage(com.virtualweaver.xotics.datamodel.XoEnvironment env, java.lang.String appName, java.lang.String instanceName) throws XapException
env
- current XO environmentappName
- target Application nameinstanceName
- target instance name
XapException
public static XapRequest createStartupMessage(com.virtualweaver.xotics.datamodel.XoEnvironment env, java.lang.String appName, java.lang.String instanceName) throws XapException
env
- current XO environmentappName
- target Application nameinstanceName
- target instance name
XapException
public static XapRequest createRequest(com.virtualweaver.xotics.datamodel.XoEnvironment env, byte type, java.lang.String appName, java.lang.String instanceName, java.lang.String handler, java.lang.String reqId, XapQueue responseQueue, com.virtualweaver.xotics.datamodel.XoObject contentObject) throws XapException
<ctx:request> <ctx:content> <any:contentObject> </ctx:content> <ctx:response> <any:response-content> </ctx:response> </ctx:request>where :
env
- XO enviroment used by XAPE enginetype
- type of request (REQ_TYPE_ONEWAY, REQ_TYPE_SYNC, REQ_TYPE_ASYNC) from XapConstants
appName
- name of target applicationinstanceName
- name of application instance, needed only to reach a
specific instance of a multi-instance applicationhandler
- optional id of a specific reqId
- an optional ID to identify this request (if null, a reqId is created internally)responseQueue
- a queue object to receive response in case of a REQ_TYPE_ASYNC request and
a target instance running in a dedicated thread (IN_DEDICATED_THREAD)contentObject
- an XO object or XO tree fragment representing the request content
XapException
- if some error occurs
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |