|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.SaxHandlerBase org.xmlBlaster.client.script.XmlScriptInterpreter org.xmlBlaster.client.script.XmlScriptClient
public class XmlScriptClient
XmlScriptClient
Example for usage:
java javaclients.XmlScript -requestFile inFile.xml -responseFile outFile.xml -updateFile updFile.xml
Field Summary |
---|
Fields inherited from class org.xmlBlaster.client.script.XmlScriptInterpreter |
---|
cdata, CONTENT_TAG, contentData, ECHO_TAG, forceReadable, inhibitContentCDATAWrapping, INPUT_TAG, key, KEY_TAG, messageList, needsRootEndTag, out, qos, QOS_TAG, response, ROOT_TAG, ROOTRESPONSE_TAG, sendSimpleExceptionFormat, simpleExceptionFormatList, updateCounter, WAIT_TAG, waitMutex, waitNumUpdates |
Fields inherited from class org.xmlBlaster.util.SaxHandlerBase |
---|
character, locator, xmlLiteral, xmlSource |
Constructor Summary | |
---|---|
XmlScriptClient(Global glob,
I_XmlBlasterAccess access,
I_Callback callback,
java.util.HashMap attachments,
java.io.OutputStream out)
This constructor is the most generic one (more degrees of freedom) |
|
XmlScriptClient(Global glob,
I_XmlBlasterAccess access,
java.io.OutputStream cbStream,
java.io.OutputStream responseStream,
java.util.HashMap attachments)
This is a convenience constructor which takes the default I_Callback implementation provided (StreamCallback). |
|
XmlScriptClient(Global glob,
java.io.OutputStream out)
Convenience constructor which takes a minimal amount of parameters. |
Method Summary | |
---|---|
boolean |
fireMethod(MethodName methodName,
java.lang.String sessionId,
java.lang.String requestId,
byte type)
On each remote method invocation this function is called. |
boolean |
isThrowAllExceptions()
|
static void |
main(java.lang.String[] args)
|
void |
registerMsgUnitCb(I_MsgUnitCb msgUnitCb)
You can register a callback which can manipulate the MsgUnit just before it is sent. |
void |
setProperty(java.lang.String key,
java.lang.String value)
Set a property into Global scope. |
void |
setThrowAllExceptions(boolean throwAllExceptions)
|
java.lang.String |
update(java.lang.String cbSessionId,
UpdateKey updateKey,
byte[] content,
UpdateQos updateQos)
If a callback handler was registered, we will be notified here about updates as well |
Methods inherited from class org.xmlBlaster.client.script.XmlScriptInterpreter |
---|
buildMsgUnit, characters, dumpToFile, endCDATA, endElement, flushResponse, initialize, parse, replaceVariable, serialize, simplifiedErrorCode, startCDATA, startElement, wrapForScripting, wrapForScripting, wrapForScripting, writeElementStart |
Methods inherited from class org.xmlBlaster.util.SaxHandlerBase |
---|
comment, endDocument, endDTD, endEntity, endPrefixMapping, error, fatalError, getUseLexicalHandler, ignorableWhitespace, init, init, init, notationDecl, processingInstruction, setDocumentLocator, setUseLexicalHandler, skippedEntity, startDocument, startDTD, startEntity, startPrefixMapping, toString, toXml, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XmlScriptClient(Global glob, I_XmlBlasterAccess access, I_Callback callback, java.util.HashMap attachments, java.io.OutputStream out)
glob
- the global to useaccess
- the I_XmlBlasterAccess to use (can be different from the default
given by the global.callback
- The I_Callback implementation to be used (you can provide your own desidered behaviour)attachments
- the attachments where to search when a content is stored in the attachment (with the 'link' attribute)out
- the OutputStream where to send the responses of the invocations done to xmlBlasterpublic XmlScriptClient(Global glob, I_XmlBlasterAccess access, java.io.OutputStream cbStream, java.io.OutputStream responseStream, java.util.HashMap attachments)
glob
- the global to useaccess
- the I_XmlBlasterAccess to use (can be different from the default
given by the global.cbStream
- the OutputStream where to send the information coming in
asynchroneously via the update method (could be different from the
synchroneous output stream).responseStream
- the synchroneous OutputStreamattachments
- the attachments where to find attached contentsStreamCallback
public XmlScriptClient(Global glob, java.io.OutputStream out)
glob
- the global to use. The I_XmlBlasterAccess will be taken from
it.out.
- The OutputStream used for all outputs (sync and async).Method Detail |
---|
public void registerMsgUnitCb(I_MsgUnitCb msgUnitCb)
public void setProperty(java.lang.String key, java.lang.String value) throws XmlBlasterException
XmlScriptInterpreter
setProperty
in class XmlScriptInterpreter
XmlBlasterException
public boolean fireMethod(MethodName methodName, java.lang.String sessionId, java.lang.String requestId, byte type) throws XmlBlasterException
XmlScriptInterpreter
fireMethod
in class XmlScriptInterpreter
type
- 'I'=invoke 'R'=response 'E'=exception
XmlBlasterException
- Will lead to stop parsing furtherpublic static void main(java.lang.String[] args)
public java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) throws XmlBlasterException
XmlScriptInterpreter
update
in interface I_Callback
update
in class XmlScriptInterpreter
cbSessionId
- The session ID specified by the client which registered the callback.
You can specify a cbSessionId during connection (with ConnectQos)
and this is bounced back here so you can authenticate the message.updateKey
- The arrived key containing the topic namecontent
- The arrived message content. This is your payload.
XmlBlasterException
I_XmlBlasterAccess
public boolean isThrowAllExceptions()
public void setThrowAllExceptions(boolean throwAllExceptions)
|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |