xmlBlaster 2.2.0 API

org.xmlBlaster.client.protocol.corba
Class CorbaCallbackServer

java.lang.Object
  extended by org.xmlBlaster.client.protocol.corba.CorbaCallbackServer
All Implemented Interfaces:
I_CallbackServer, BlasterCallbackOperations, I_Plugin

public final class CorbaCallbackServer
extends java.lang.Object
implements BlasterCallbackOperations, I_CallbackServer

Example for a CORBA callback implementation.

You can use this default callback handling with your clients, but if you need other handling of callbacks, take a copy of this Callback implementation and add your own code.

See Also:
CORBA xmlBlaster.idl

Field Summary
private  I_CallbackExtended boss
           
private  BlasterCallback callback
           
private  CallbackAddress callbackAddress
           
private  Global glob
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
private  org.omg.CORBA.ORB orb
           
private  PluginInfo pluginInfo
           
private  org.omg.PortableServer.POA rootPOA
           
 
Constructor Summary
CorbaCallbackServer()
          Called by plugin loader which calls init(Global, PluginInfo) thereafter.
CorbaCallbackServer(Global glob, java.lang.String name, CallbackAddress callbackAddress, I_CallbackExtended boss, org.omg.CORBA.ORB orb_)
          Construct a CORBA callback server for xmlBlaster, used by java/corba clients.
 
Method Summary
private  void createCallbackServer()
          Building a Callback server, using the tie approach.
 java.lang.String getCbAddress()
          Returns the current callback address.
 java.lang.String getCbProtocol()
          Returns the 'well known' protocol type.
 java.lang.String getType()
          Enforced by I_Plugin
 java.lang.String getVersion()
          Enforced by I_Plugin
 void init(Global glob, PluginInfo pluginInfo)
          This method is called by the PluginManager (enforced by I_Plugin).
 void initialize(Global glob, java.lang.String name, CallbackAddress callbackAddress, I_CallbackExtended boss)
          Construct a CORBA callback server for xmlBlaster, used by java/corba clients.
 java.lang.String ping(java.lang.String qos)
          Ping to check if the callback server is alive.
 void shutdown()
          Shutdown the callback server.
 java.lang.String[] update(java.lang.String cbSessionId, MessageUnit[] msgUnitArr)
          This is the callback method invoked from the CORBA server informing the client in an asynchronous mode about new messages.
 void updateOneway(java.lang.String cbSessionId, MessageUnit[] msgUnitArr)
          This is the callback method invoked from the CORBA server informing the client in an asynchronous mode about new messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

orb

private org.omg.CORBA.ORB orb

rootPOA

private org.omg.PortableServer.POA rootPOA

callback

private BlasterCallback callback

ME

private java.lang.String ME

glob

private Global glob

log

private static java.util.logging.Logger log

boss

private I_CallbackExtended boss

callbackAddress

private CallbackAddress callbackAddress

pluginInfo

private PluginInfo pluginInfo
Constructor Detail

CorbaCallbackServer

public CorbaCallbackServer()
Called by plugin loader which calls init(Global, PluginInfo) thereafter.


CorbaCallbackServer

public CorbaCallbackServer(Global glob,
                           java.lang.String name,
                           CallbackAddress callbackAddress,
                           I_CallbackExtended boss,
                           org.omg.CORBA.ORB orb_)
                    throws XmlBlasterException
Construct a CORBA callback server for xmlBlaster, used by java/corba clients.

Parameters:
name - The login name of the client, for logging and identification with update() callbacks.
boss - My client which wants to receive the update() calls.
orb - A handle to my initialized orb
Throws:
XmlBlasterException
Method Detail

initialize

public void initialize(Global glob,
                       java.lang.String name,
                       CallbackAddress callbackAddress,
                       I_CallbackExtended boss)
                throws XmlBlasterException
Construct a CORBA callback server for xmlBlaster, used by java/corba clients.

Specified by:
initialize in interface I_CallbackServer
Parameters:
name - The login name of the client, for logging only
boss - My client which wants to receive the update() calls.
glob - The global handle with your environment settings
callbackAddress - The address configuration of this callback server
Throws:
XmlBlasterException

getType

public java.lang.String getType()
Enforced by I_Plugin

Specified by:
getType in interface I_Plugin

getVersion

public java.lang.String getVersion()
Enforced by I_Plugin

Specified by:
getVersion in interface I_Plugin

init

public void init(Global glob,
                 PluginInfo pluginInfo)
This method is called by the PluginManager (enforced by I_Plugin).

Specified by:
init in interface I_Plugin
See Also:
I_Plugin.init(org.xmlBlaster.util.Global,org.xmlBlaster.util.plugin.PluginInfo)

createCallbackServer

private void createCallbackServer()
                           throws XmlBlasterException
Building a Callback server, using the tie approach.

Throws:
XmlBlasterException - if the BlasterCallback server can't be created id="CallbackCreationError"

shutdown

public void shutdown()
Shutdown the callback server.

Specified by:
shutdown in interface I_CallbackServer
Specified by:
shutdown in interface I_Plugin

getCbProtocol

public final java.lang.String getCbProtocol()
Description copied from interface: I_CallbackServer
Returns the 'well known' protocol type.

Specified by:
getCbProtocol in interface I_CallbackServer
Returns:
The protocol name "IOR"

getCbAddress

public java.lang.String getCbAddress()
                              throws XmlBlasterException
Description copied from interface: I_CallbackServer
Returns the current callback address.

Specified by:
getCbAddress in interface I_CallbackServer
Returns:
The stringified IOR of this server, which can be used for the connectQos
Throws:
XmlBlasterException

updateOneway

public void updateOneway(java.lang.String cbSessionId,
                         MessageUnit[] msgUnitArr)
This is the callback method invoked from the CORBA server informing the client in an asynchronous mode about new messages.

It implements the interface BlasterCallbackOperations.

The call is converted to the native MsgUnitRaw, and the other update() method of this class is invoked.

This oneway method does not return something, it is high performing but you loose the application level hand shake.

Specified by:
updateOneway in interface BlasterCallbackOperations
Parameters:
msgUnitArr - Contains a MsgUnitRaw structs (your message) for CORBA
See Also:
CORBA xmlBlaster.idl

update

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

It implements the interface BlasterCallbackOperations.

The call is converted to the native MsgUnitRaw, and the other update() method of this class is invoked.

Specified by:
update in interface BlasterCallbackOperations
Parameters:
msgUnitArr - Contains a MsgUnitRaw structs (your message) for CORBA
Throws:
XmlBlasterException
See Also:
CORBA xmlBlaster.idl

ping

public java.lang.String ping(java.lang.String qos)
Ping to check if the callback server is alive.

Specified by:
ping in interface BlasterCallbackOperations
See Also:
I_CallbackDriver.ping(String)

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.