jrunx.cluster
Class BroadcastAlgorithm

java.lang.Object
  |
  +--jrunx.cluster.ClusterAlgorithm
        |
        +--jrunx.cluster.RoundRobinAlgorithm
              |
              +--jrunx.cluster.StickyRoundRobinAlgorithm
                    |
                    +--jrunx.cluster.BroadcastAlgorithm
All Implemented Interfaces:
ClusterConstants, java.io.Serializable

public class BroadcastAlgorithm
extends StickyRoundRobinAlgorithm

A cluster algorithm that re-invokes certain methods -- usually "write" methods, or setters -- methods on every service instance in the cluster. For most methods, it performs the same logic as StickyRoundRobinAlgorithm, which is its super class. Only specified methods are re-invoked on all stubs.
For example, The JNDI ContextManager is a ClusterableService that uses this algorithm to ensure that bind, rebind, and unbind operations are invoked on every JNDI service in the cluster. Any other method -- such as lookup -- is performed on only one stub, chosen at random using the super class StickyRoundRobinAlgorithm logic.
By default, all known services are broadcasted to. You can specify specific servers to broadcast to, however, when adding broadcasted methods.

Author:
PS Neville
See Also:
Serialized Form

Fields inherited from class jrunx.cluster.StickyRoundRobinAlgorithm
stickyServer
 
Fields inherited from class jrunx.cluster.RoundRobinAlgorithm
cursor
 
Fields inherited from class jrunx.cluster.ClusterAlgorithm
rand
 
Fields inherited from interface jrunx.cluster.ClusterConstants
AVAILABLE_SERVICES, CLUSTER_MANAGER_JNDI, DEFAULT_CLUSTER_DOMAIN, DEFAULT_ENABLED, JINI_CODE_BASE_JAR, PRIMARY_SERVICE, SECONDARY_SERVICE
 
Constructor Summary
BroadcastAlgorithm()
           
 
Method Summary
 void addBroadcastMethod(java.lang.String method)
           
 void addBroadcastMethod(java.lang.String method, java.util.Collection servers)
           
protected  Invocation invokeService(Invocation inv, ClusterableService svc)
           
 
Methods inherited from class jrunx.cluster.StickyRoundRobinAlgorithm
selectService
 
Methods inherited from class jrunx.cluster.ClusterAlgorithm
chooseRandom, chooseRandom, chooseStub, getPrefered, invokeService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BroadcastAlgorithm

public BroadcastAlgorithm()
Method Detail

addBroadcastMethod

public void addBroadcastMethod(java.lang.String method)

addBroadcastMethod

public void addBroadcastMethod(java.lang.String method,
                               java.util.Collection servers)

invokeService

protected Invocation invokeService(Invocation inv,
                                   ClusterableService svc)
                            throws java.lang.Throwable
Overrides:
invokeService in class ClusterAlgorithm


Copyright � 2002 Macromedia Corporation. All Rights Reserved.