xmlBlaster 2.1.0 API

org.xmlBlaster.contrib
Interface I_ChangePublisher

All Superinterfaces:
java.util.EventListener, I_ContribPlugin
All Known Implementing Classes:
MomEventEngine, SqlInfoStreamPublisher, TestDbBasics, TestDbSpecific, TestSyncPart, XmlBlasterPublisher

public interface I_ChangePublisher
extends java.util.EventListener, I_ContribPlugin

Interface to hide the publisher destination.

A typical plugin publishes the changes to xmlBlaster MoM but could be any other data sink like JMS or file system as well.

Author:
Marcel Ruff

Method Summary
 XBSession getJmsSession()
          Only used in replication, can return null if not used.
 void init(I_Info info)
          After creation this method is called.
 java.lang.String publish(java.lang.String changeKey, byte[] message, java.util.Map attrMap)
          Send the message to the MoM.
 boolean registerAlertListener(I_Update update, java.util.Map attrs)
          Register for alerts when the data source has changed.
 void shutdown()
          Cleanup resources.
 
Methods inherited from interface org.xmlBlaster.contrib.I_ContribPlugin
getUsedPropertyKeys
 

Method Detail

init

void init(I_Info info)
          throws java.lang.Exception
After creation this method is called. The plugin must register itself into global scope with info.setObject("org.xmlBlaster.contrib.dbwatcher.mom.I_ChangePublisher", this) to be available for others.

Specified by:
init in interface I_ContribPlugin
Parameters:
info - The configuration environment
Throws:
java.lang.Exception - MoM specific

publish

java.lang.String publish(java.lang.String changeKey,
                         byte[] message,
                         java.util.Map attrMap)
                         throws java.lang.Exception
Send the message to the MoM.

Parameters:
changeKey - Can be used to create the topic name
message - The message content to send
attrMap - An optional map with attributes or null
Returns:
A unique identifier of the sent message
Throws:
java.lang.Exception - On sending problems

registerAlertListener

boolean registerAlertListener(I_Update update,
                              java.util.Map attrs)
                              throws java.lang.Exception
Register for alerts when the data source has changed.

This funtionality is plugin depending, for example the xmlBlaster plugin has a configuration option to subscribe on a alert topic and listens if somebody publishes a message to it. If such a message arrives we trigger a new database poll.

Parameters:
update - The callback interface to receive the notification
attrs - extra parameters to pass for the registration. For example if one implementation wants to do a specific extra subscription it would pass the quality of service in the attributes.
Returns:
true if a notification is available (is configured)
Throws:
java.lang.Exception - The MoM specific exception

shutdown

void shutdown()
Cleanup resources.

Can be called multiple times if instance is reused from different plugins.

Specified by:
shutdown in interface I_ContribPlugin
See Also:
I_Plugin

getJmsSession

XBSession getJmsSession()
Only used in replication, can return null if not used.

Returns:

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.