xmlBlaster 2.2.0 API

org.xmlBlaster.engine.cluster
Interface I_MapMsgToMasterId

All Known Implementing Classes:
DomainToMaster

public interface I_MapMsgToMasterId

Interface to implementation which finds the master cluster node of a given message.

Author:
xmlBlaster@marcelruff.info

Method Summary
 NodeMasterInfo getMasterId(NodeMasterInfo nodeMasterInfo, MsgUnit msgUnit)
          Find out who is the master of the provided message.
 java.lang.String[] getMimeExtended()
          Get the content MIME version number for which this plugin applies.
 java.lang.String[] getMimeTypes()
          Get the content MIME types for which this plugin applies, "*" is for all mime types
 java.lang.String getName()
          Get a human readable name of the implementation
 void initialize(ServerScope glob, ClusterManager clusterManager)
          This is called after instantiation of the plugin.
 void reset()
          Is called when new configuration arrived, notify the plugin to empty its cache or do whatever it needs to do.
 

Method Detail

initialize

void initialize(ServerScope glob,
                ClusterManager clusterManager)
This is called after instantiation of the plugin. We pass the engine.Global handle which has more knowledge then the util.Global passed by I_Plugin (we could have down casted though).

Parameters:
glob - The Global handle of this xmlBlaster server instance.

reset

void reset()
Is called when new configuration arrived, notify the plugin to empty its cache or do whatever it needs to do.


getName

java.lang.String getName()
Get a human readable name of the implementation


getMimeTypes

java.lang.String[] getMimeTypes()
Get the content MIME types for which this plugin applies, "*" is for all mime types

Returns:
The supported mime types, for example return { "text/plain", "text/xml", "application/mytext" };

getMimeExtended

java.lang.String[] getMimeExtended()
Get the content MIME version number for which this plugin applies. The returned String array length must be the same as this of getMimeTypes(), the index corresponds to the index of getMimeTypes().
For example "stable" is the extended mime type of "application/mytext" (see getMimeTypes()).

Returns:
E.g. a string array like { "1.0", "1.3", "stable" }

getMasterId

NodeMasterInfo getMasterId(NodeMasterInfo nodeMasterInfo,
                           MsgUnit msgUnit)
                           throws XmlBlasterException
Find out who is the master of the provided message.

Here you code your clustering logic.

Parameters:
nodeMasterInfo - The mapping rule to find the master
msgUnit - The message
Returns:
The nodeMasterInfo (same as you passed as parameter) it this is a possible master or null if not suitable.
You can access the master ClusterNode with nodeMasterInfo.getClusterNode() and the xmlBlasterConnection to the master node with nodeMasterInfo.getClusterNode().getXmlBlasterAccess()
Throws:
XmlBlasterException

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.