xmlBlaster 2.1.0 API

org.xmlBlaster.engine.cluster.simpledomain
Class RoundRobin

java.lang.Object
  extended by org.xmlBlaster.engine.cluster.simpledomain.RoundRobin
All Implemented Interfaces:
I_LoadBalancer, I_Plugin

public final class RoundRobin
extends java.lang.Object
implements I_LoadBalancer, I_Plugin

Implements dummy load balancing for xmlBlaster using round robin approach.

Since:
0.79e
Author:
xmlBlaster@marcelruff.info

Field Summary
private  int counter
           
private  ServerScope glob
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
 
Constructor Summary
RoundRobin()
           
 
Method Summary
 NodeMasterInfo getClusterNode(java.util.Set nodeMasterInfoSet)
          We determine which xmlBlaster node to choose with a simple counter.
 java.lang.String getName()
          Get a human readable name of this filter implementation
 java.lang.String getType()
          Return plugin type for Plugin loader
 java.lang.String getVersion()
          Return plugin version for Plugin loader
 void init(Global glob, PluginInfo pluginInfo)
          This method is called by the PluginManager (enforced by I_Plugin).
 void initialize(ServerScope glob, ClusterManager clusterManager)
          This is called after instantiation of the plugin
 void shutdown()
          Cleans up the resource.
 
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 ServerScope glob

log

private static java.util.logging.Logger log

counter

private int counter
Constructor Detail

RoundRobin

public RoundRobin()
Method Detail

initialize

public void initialize(ServerScope glob,
                       ClusterManager clusterManager)
This is called after instantiation of the plugin

Specified by:
initialize in interface I_LoadBalancer
Parameters:
glob - The Global handle of this xmlBlaster server instance.
clusterManager - My manager

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)

getType

public java.lang.String getType()
Return plugin type for Plugin loader

Specified by:
getType in interface I_Plugin
Returns:
"RoundRobin"

getVersion

public java.lang.String getVersion()
Return plugin version for Plugin loader

Specified by:
getVersion in interface I_Plugin
Returns:
"1.0"

getName

public java.lang.String getName()
Get a human readable name of this filter implementation

Returns:
"RoundRobin"

getClusterNode

public NodeMasterInfo getClusterNode(java.util.Set nodeMasterInfoSet)
                              throws XmlBlasterException
We determine which xmlBlaster node to choose with a simple counter.

Specified by:
getClusterNode in interface I_LoadBalancer
Parameters:
nodeMasterInfoSet - A set containing NodeMasterInfo objects, the possible xmlBlaster nodes. Is never null, but may have a size of 0.
Returns:
The chosen nodeMasterInfo to handle the message or null to handle it locally
Throws:
XmlBlasterException
See Also:
I_LoadBalancer.getClusterNode(java.util.Set)

shutdown

public void shutdown()
              throws XmlBlasterException
Description copied from interface: I_Plugin
Cleans up the resource.

Specified by:
shutdown in interface I_Plugin
Throws:
XmlBlasterException - if an exception occurs. The exception is handled by the RunLevelManager depending on how the plugin has been configured with the action:

<action do='STOP' onShutdownRunlevel='2' sequence='5' onFail='resource.configuration.pluginFailed'> If onFail is defined to something, the RunLevelManager will stop.


xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.