xmlBlaster 2.1.0 API

org.xmlBlaster.client.protocol.local
Class LocalCallbackImpl

java.lang.Object
  extended by org.xmlBlaster.client.protocol.local.LocalCallbackImpl
All Implemented Interfaces:
I_CallbackServer, I_Plugin

public class LocalCallbackImpl
extends java.lang.Object
implements I_CallbackServer

A client callback driver for in jvm calls. the start/invocation sequence for the local protocol is now decoupled. This means that the client can come before the server and the server can come before the client (as would normally be the case when recovering from persistence). This means that even when choosing the local protocol there could be the situation where the client is not (yet/anymore) available, particularly on run level changes.

Author:
Michele Laghi., Marcel Ruff., Peter Antman.
See Also:
The protocol.local requirement

Field Summary
private  java.lang.String callbackId
          The id (raw address of this object
private  I_CallbackExtended cbClient
          The access callback
private  ServerScope engineGlob
          The serverside engine global, used as a naming store
private  Global glob
           
private  java.lang.String ME
           
 
Constructor Summary
LocalCallbackImpl()
          Called by plugin loader which calls init(Global, PluginInfo) thereafter.
 
Method Summary
 java.lang.String getCbAddress()
          Returns the callback address.
 java.lang.String getCbProtocol()
          Returns the 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 not used, since callbacks plugins are actually factories.
 void initialize(Global glob, java.lang.String loginName, CallbackAddress callbackAddress, I_CallbackExtended cbClient)
          Initialize the callback server.
 void shutdown()
          Shutdown callback, called by LocalConnection on problems
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private java.lang.String ME

glob

private Global glob

cbClient

private I_CallbackExtended cbClient
The access callback


callbackId

private java.lang.String callbackId
The id (raw address of this object


engineGlob

private ServerScope engineGlob
The serverside engine global, used as a naming store

Constructor Detail

LocalCallbackImpl

public LocalCallbackImpl()
Called by plugin loader which calls init(Global, PluginInfo) thereafter. A thread receiving all messages from xmlBlaster, and delivering them back to the client code.

Method Detail

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 not used, since callbacks plugins are actually factories. 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)

initialize

public final void initialize(Global glob,
                             java.lang.String loginName,
                             CallbackAddress callbackAddress,
                             I_CallbackExtended cbClient)
                      throws XmlBlasterException
Initialize the callback server.

The server will register itself in the serverside engine global as its raw Address. Any serverside callback driver must use the address to look the object up and invoke it directly.

The given global must contain the serverside org.xmlBlaster.engine.Global in its ObjectEntry "ServerNodeScope"

Specified by:
initialize in interface I_CallbackServer
Parameters:
glob - The global handle with your environment settings
loginName - The login name of the client, for logging only
callbackAddress - The address configuration of this callback server
cbClient - Your implementation to receive the callback messages from xmlBlaster
Throws:
XmlBlasterException

getCbProtocol

public final java.lang.String getCbProtocol()
Returns the protocol type.

Specified by:
getCbProtocol in interface I_CallbackServer
Returns:
"LOCAL"

getCbAddress

public java.lang.String getCbAddress()
                              throws XmlBlasterException
Returns the callback address.

This is no listen local, as we need no callback server. It is just the client side local data of the established connection to xmlBlaster.

Specified by:
getCbAddress in interface I_CallbackServer
Returns:
"LOCAL:3020001"
Throws:
XmlBlasterException

shutdown

public void shutdown()
Shutdown callback, called by LocalConnection on problems

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

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.