xmlBlaster 2.1.0 API

org.xmlBlaster.client.protocol
Class AbstractCallbackExtended

java.lang.Object
  extended by org.xmlBlaster.client.protocol.AbstractCallbackExtended
All Implemented Interfaces:
I_Callback, I_CallbackRaw, I_CallbackExtended
Direct Known Subclasses:
XmlBlasterAccess

public abstract class AbstractCallbackExtended
extends java.lang.Object
implements I_CallbackExtended

This is a little abstract helper class which extends the I_CallbackExtended interface to become suited for protocols like xml-rpc. Note that you need to extend this class because one of the update methods is abstract.

Version:
$Revision: 1.16 $
Author:
Michele Laghi, Marcel Ruff.

Field Summary
protected  Global glob
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
protected  boolean updateBulkAck
           
 
Constructor Summary
AbstractCallbackExtended(Global glob)
           
 
Method Summary
 DispatchStatistic getDispatchStatistic()
          Access the statistic holder.
abstract  I_ClientPlugin getSecurityPlugin()
           
 java.lang.String[] update(java.lang.String cbSessionId, MsgUnitRaw[] msgUnitArr)
          This is the callback method invoked natively informing the client in an asynchronous mode about new messages.
 java.lang.String update(java.lang.String cbSessionId, java.lang.String updateKeyLiteral, byte[] content, java.lang.String updateQosLiteral)
          It parses the string literals passed in the argument list and calls subsequently the update method with the signature defined in I_Callback.
abstract  java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos)
          The class which extends AbstractCallbackExtended must implement this method.
 void updateOneway(java.lang.String cbSessionId, MsgUnitRaw[] msgUnitArr)
          The oneway variant without a return value or exception
 void updateOneway(java.lang.String cbSessionId, java.lang.String updateKeyLiteral, byte[] content, java.lang.String updateQosLiteral)
          The oneway variant without a return value or exception

We match it to the blocking variant.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xmlBlaster.client.protocol.I_CallbackExtended
lostConnection
 

Field Detail

ME

private java.lang.String ME

glob

protected final Global glob

log

private static java.util.logging.Logger log

updateBulkAck

protected boolean updateBulkAck
Constructor Detail

AbstractCallbackExtended

public AbstractCallbackExtended(Global glob)
Parameters:
glob - If null we use Global.instance()
Method Detail

getSecurityPlugin

public abstract I_ClientPlugin getSecurityPlugin()

getDispatchStatistic

public DispatchStatistic getDispatchStatistic()
Access the statistic holder. Implementing classes should provide a valid statistic handle.

Returns:
Can be null

update

public java.lang.String update(java.lang.String cbSessionId,
                               java.lang.String updateKeyLiteral,
                               byte[] content,
                               java.lang.String updateQosLiteral)
                        throws XmlBlasterException
It parses the string literals passed in the argument list and calls subsequently the update method with the signature defined in I_Callback.

This method is invoked by certain protocols only. Others might directly invoke the update method with the other signature.

Specified by:
update in interface I_CallbackExtended
Parameters:
cbSessionId - The session ID specified by the client which registered the callback
updateKeyLiteral - The arrived key (as an xml-string)
content - The arrived message content
updateQosLiteral - Quality of Service of the MsgUnitRaw (as an xml-string)
Throws:
XmlBlasterException
See Also:
I_CallbackExtended

updateOneway

public void updateOneway(java.lang.String cbSessionId,
                         java.lang.String updateKeyLiteral,
                         byte[] content,
                         java.lang.String updateQosLiteral)
The oneway variant without a return value or exception

We match it to the blocking variant. Implement this in your code on demand.

Specified by:
updateOneway in interface I_CallbackExtended

update

public java.lang.String[] update(java.lang.String cbSessionId,
                                 MsgUnitRaw[] msgUnitArr)
                          throws XmlBlasterException
This is the callback method invoked natively informing the client in an asynchronous mode about new messages.

It implements the interface I_CallbackRaw.

It nicely converts the raw MsgUnitRaw with raw Strings and arrays in corresponding objects and calls for every received message the I_Callback.update(), which you need to implement in your code.

Specified by:
update in interface I_CallbackRaw
Parameters:
msgUnitArr - Contains MsgUnitRaw structs (your message) in native form
Returns:
For every message a return QoS
Throws:
XmlBlasterException

updateOneway

public void updateOneway(java.lang.String cbSessionId,
                         MsgUnitRaw[] msgUnitArr)
The oneway variant without a return value or exception

Specified by:
updateOneway in interface I_CallbackRaw

update

public abstract java.lang.String update(java.lang.String cbSessionId,
                                        UpdateKey updateKey,
                                        byte[] content,
                                        UpdateQos updateQos)
                                 throws XmlBlasterException
The class which extends AbstractCallbackExtended must implement this method.

You receive one message, which is completely parsed and checked.

Specified by:
update in interface I_Callback
Parameters:
cbSessionId - The session ID specified by the client which registered the callback
updateKey - The arrived key (as an xml-string)
content - The arrived message content
updateQos - Quality of Service of the MsgUnitRaw as an xml-string
Throws:
XmlBlasterException
See Also:
I_Callback

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.