xmlBlaster 2.2.0 API

javaclients
Class ClientSubDispatch

java.lang.Object
  extended by javaclients.ClientSubDispatch
All Implemented Interfaces:
I_Callback

public class ClientSubDispatch
extends java.lang.Object
implements I_Callback

This client demonstrates the method subscribe() with a later publish().

We use a subscribe variant, where for every subscribe we define a specialized update method.
Like this not all callback messages arrive in a centralized update() with the need to look into them and decide why the arrived.

This demo uses the I_XmlBlasterAccess helper class, which hides the raw CORBA/RMI/XMLRPC nastiness and allows this client side dispatching.
Invoke examples:

    java -cp ../../lib/xmlBlaster.jar javaclients.ClientSubDispatch

    java javaclients.ClientSubDispatch -loginName Jeff -dispatch/connection/protocol RMI

    java javaclients.ClientSubDispatch -help
 


Field Summary
private  Global glob
           
private static java.util.logging.Logger log
           
private static java.lang.String ME
           
private  int numReceived1
           
private  int numReceived2
           
 
Constructor Summary
ClientSubDispatch(Global glob)
           
 
Method Summary
static void main(java.lang.String[] args)
           
 java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos)
          This is the callback method invoked from xmlBlaster delivering us a new asynchronous message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private static java.lang.String ME

glob

private final Global glob

log

private static java.util.logging.Logger log

numReceived1

private int numReceived1

numReceived2

private int numReceived2
Constructor Detail

ClientSubDispatch

public ClientSubDispatch(Global glob)
Method Detail

update

public java.lang.String update(java.lang.String cbSessionId,
                               UpdateKey updateKey,
                               byte[] content,
                               UpdateQos updateQos)
This is the callback method invoked from xmlBlaster delivering us a new asynchronous message.

Specified by:
update in interface I_Callback
Parameters:
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 name
content - The arrived message content. This is your payload.
See Also:
I_Callback.update(String, UpdateKey, byte[], UpdateQos)

main

public static void main(java.lang.String[] args)

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.