|
xmlBlaster 1.6.4 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.beans.SimpleBeanInfo org.xmlBlaster.client.activex.XmlScriptAccess
This bean can be exported to a Microsoft dll (ActiveX component) and be accessed by C# or Visual Basic.Net
Here we support XML scripting access as described in the client.script requirement
by calling sendRequest()
or alternatively you can use the methods
like publishStr()
or subscribe()
directly. The latter
methods have the advantage to return a ready parsed object to the ActiveX component,
for example Visual Basic can directly call all methods of SubscribeReturnQos
which is returned by subscribe()
.
Compile the ActiveX control with build activex
and see Visual Basic
and C# samples in directory xmlBlaster/demo/activex
.
As events into ActiveX can't have a return value and can't throw
an exception back to us we handle it here as a callback, for example
Visual Basic needs to call sendUpdateReturn()
or sendUpdateException()
after
processing a message received by update()
.
Our update thread blocks until one of those two methods is called, however
the blocking times out after 10 minutes which is adjustable with
the property client/activex/responseWaitTime
given in milli seconds.
One instance of this can hold one permanent connection to the xmlBlaster server, multi threaded access is supported.
Field Summary | |
private Global |
glob
|
private XmlScriptInterpreter |
interpreter
|
private static java.util.logging.Logger |
log
|
private static java.lang.String |
ME
|
private java.io.OutputStream |
outStream
|
private java.io.Reader |
reader
|
private long |
responseWaitTime
|
private UpdateListener |
updateListener
|
private XmlBlasterException |
updateReturnException
|
private EDU.oswego.cs.dl.util.concurrent.Latch |
updateReturnLatch
|
private java.lang.String |
updateReturnQos
|
Fields inherited from interface java.beans.BeanInfo |
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32 |
Constructor Summary | |
XmlScriptAccess()
Create a new access bean. |
Method Summary | |
void |
addUpdateListener(UpdateListener updateListener)
Add a C# / VisualBasic listener over the ActiveX bridge. |
ConnectReturnQos |
connect(java.lang.String xmlQos)
Login to xmlBlaster. |
java.util.Properties |
createPropertiesInstance()
Access a Properties object to be used later for initialize(). |
SynchronousCache |
createSynchronousCache(int size)
Setup the cache mode. |
boolean |
disconnect(java.lang.String xmlQos)
Logout from the server, free all server and client side resources. |
EraseReturnQos[] |
erase(java.lang.String xmlKey,
java.lang.String xmlQos)
|
MsgUnit[] |
get(java.lang.String xmlKey,
java.lang.String xmlQos)
Get synchronous messages. |
MsgUnit[] |
getCached(java.lang.String xmlKey,
java.lang.String xmlQos)
|
I_CallbackServer |
getCbServer()
Access the callback server which is currently used in I_XmlBlasterAccess. |
Global |
getGlobal()
Access the handle of this xmlBlaster connection. |
java.lang.String |
getId()
|
void |
initArgs(java.lang.String[] args)
Initialize the environment. |
void |
initialize(java.util.Properties properties)
Initialize the environment. |
boolean |
isConnected()
Has the connect() method successfully passed? |
void |
leaveServer()
Leaves the connection to the server. |
static void |
main(java.lang.String[] args)
For testing: java org.xmlBlaster.client.activex.XmlScriptAccess |
protected java.lang.String |
notifyUpdateEvent(java.lang.String cbSessionId,
UpdateKey key,
byte[] content,
UpdateQos qos)
Fire an event into C# / VisualBasic containing an updated message. |
PublishReturnQos |
publishBlob(java.lang.String xmlKey,
byte[] content,
java.lang.String xmlQos)
Publish a message. |
PublishReturnQos |
publishStr(java.lang.String xmlKey,
java.lang.String contentStr,
java.lang.String xmlQos)
Publish a message. |
void |
refreshSession()
If no communication takes place longer the the lifetime of the session we can refresh the session to avoid auto logout |
void |
removeUpdateListener(UpdateListener updateListener)
Remove a C# / VisualBasic listener. |
java.lang.String |
sendRequest(java.lang.String xmlRequest)
Send xml encoded requests to the xmlBlaster server. |
void |
setUpdateException(java.lang.String errorCode,
java.lang.String message)
ActiveX code can call this method to return an exception for the current update message |
void |
setUpdateReturn(java.lang.String updateReturnQos)
ActiveX code needs to call this method to set the return value for the current update message. |
SubscribeReturnQos |
subscribe(java.lang.String xmlKey,
java.lang.String xmlQos)
Subscribe to messages. |
java.lang.String |
toXml()
Dump state of this client connection handler into an XML ASCII string. |
UnSubscribeReturnQos[] |
unSubscribe(java.lang.String xmlKey,
java.lang.String xmlQos)
Cancel subscription. |
java.lang.String |
update(java.lang.String cbSessionId,
UpdateKey updateKey,
byte[] content,
UpdateQos updateQos)
Enforced by I_Callback |
Methods inherited from class java.beans.SimpleBeanInfo |
getAdditionalBeanInfo, getBeanDescriptor, getDefaultEventIndex, getDefaultPropertyIndex, getEventSetDescriptors, getIcon, getMethodDescriptors, getPropertyDescriptors, loadImage |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static java.lang.String ME
private final Global glob
private static java.util.logging.Logger log
private XmlScriptInterpreter interpreter
private java.io.Reader reader
private java.io.OutputStream outStream
private UpdateListener updateListener
private EDU.oswego.cs.dl.util.concurrent.Latch updateReturnLatch
private java.lang.String updateReturnQos
private XmlBlasterException updateReturnException
private long responseWaitTime
Constructor Detail |
public XmlScriptAccess()
Method Detail |
public void addUpdateListener(UpdateListener updateListener)
public void removeUpdateListener(UpdateListener updateListener)
protected java.lang.String notifyUpdateEvent(java.lang.String cbSessionId, UpdateKey key, byte[] content, UpdateQos qos) throws XmlBlasterException
XmlBlasterException
public void setUpdateReturn(java.lang.String updateReturnQos)
updateReturnQos
- for example "public void setUpdateException(java.lang.String errorCode, java.lang.String message)
errorCode
- Only known ErrorCode strings of type "user.*" are allowedErrorCode
public java.util.Properties createPropertiesInstance()
public void initialize(java.util.Properties properties)
public void initArgs(java.lang.String[] args)
args
- Command line arguments for example { "-protocol", SOCKET, "-logging", "FINE" }public Global getGlobal()
public java.lang.String sendRequest(java.lang.String xmlRequest)
All
- caught exceptions are thrown as RuntimeExceptionpublic SynchronousCache createSynchronousCache(int size)
I_XmlBlasterAccess.createSynchronousCache(int)
,
client.cache requirementpublic ConnectReturnQos connect(java.lang.String xmlQos) throws XmlBlasterException
XmlBlasterException
I_XmlBlasterAccess.connect(ConnectQos, org.xmlBlaster.client.I_Callback)
,
interface.connect requirementpublic void leaveServer()
I_XmlBlasterAccess.leaveServer(java.util.Map)
public boolean isConnected()
I_XmlBlasterAccess.isConnected()
public void refreshSession() throws XmlBlasterException
XmlBlasterException
I_XmlBlasterAccess.refreshSession()
public I_CallbackServer getCbServer()
I_XmlBlasterAccess.getCbServer()
public java.lang.String getId()
I_XmlBlasterAccess.getId()
public boolean disconnect(java.lang.String xmlQos) throws XmlBlasterException
XmlBlasterException
I_XmlBlasterAccess.disconnect(DisconnectQos)
,
interface.disconnect requirementpublic SubscribeReturnQos subscribe(java.lang.String xmlKey, java.lang.String xmlQos) throws XmlBlasterException
xmlKey
- Which message topics to retrievexmlQos
- Control the behavior and further filter messages with mime based filter plugins
XmlBlasterException
- like ErrorCode.USER_NOT_CONNECTED and othersI_XmlBlasterAccess.subscribe(SubscribeKey, SubscribeQos, I_Callback)
public UnSubscribeReturnQos[] unSubscribe(java.lang.String xmlKey, java.lang.String xmlQos) throws XmlBlasterException
XmlBlasterException
I_XmlBlasterAccess.unSubscribe(UnSubscribeKey, UnSubscribeQos)
,
interface.unSubscribe requirementpublic MsgUnit[] get(java.lang.String xmlKey, java.lang.String xmlQos) throws XmlBlasterException
xmlKey
- Which message topics to retrievexmlQos
- Control the behavior and further filter messages with mime based filter plugins
XmlBlasterException
- like ErrorCode.USER_NOT_CONNECTED and othersI_XmlBlasterAccess.get(GetKey, GetQos)
public MsgUnit[] getCached(java.lang.String xmlKey, java.lang.String xmlQos) throws XmlBlasterException
XmlBlasterException
I_XmlBlasterAccess.getCached(GetKey, GetQos)
public PublishReturnQos publishStr(java.lang.String xmlKey, java.lang.String contentStr, java.lang.String xmlQos) throws XmlBlasterException
xmlKey
- The message topiccontentStr
- The payload as a stringxmlQos
- Control the behavior
XmlBlasterException
- like ErrorCode.USER_NOT_CONNECTED and othersI_XmlBlasterAccess.publish(org.xmlBlaster.util.MsgUnit)
public PublishReturnQos publishBlob(java.lang.String xmlKey, byte[] content, java.lang.String xmlQos) throws XmlBlasterException
xmlKey
- The message topiccontent
- The payload as binary blobxmlQos
- Control the behavior
XmlBlasterException
- like ErrorCode.USER_NOT_CONNECTED and othersI_XmlBlasterAccess.publish(org.xmlBlaster.util.MsgUnit)
public EraseReturnQos[] erase(java.lang.String xmlKey, java.lang.String xmlQos) throws XmlBlasterException
XmlBlasterException
public java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) throws XmlBlasterException
update
in interface I_Callback
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 java.lang.String toXml()
public static void main(java.lang.String[] args)
|
xmlBlaster 1.6.4 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |