jrunx.cluster
Class StickyRoundRobinAlgorithm

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

public class StickyRoundRobinAlgorithm
extends RoundRobinAlgorithm

This extension of the RoundRobin algorithm differs from its superclass in that it randomly selects a ClusterableService only when it needs to, such as on a recoverable failure or on the first invocation, and otherwise pins invocations to the same service it has selected previously.

Author:
PS Neville
See Also:
Serialized Form

Field Summary
 ClusterableService 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
StickyRoundRobinAlgorithm()
           
StickyRoundRobinAlgorithm(ClusterableService primary)
           
 
Method Summary
 ClusterableService selectService(java.util.ArrayList services)
           
 
Methods inherited from class jrunx.cluster.ClusterAlgorithm
chooseRandom, chooseRandom, chooseStub, getPrefered, invokeService, invokeService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stickyServer

public ClusterableService stickyServer
Constructor Detail

StickyRoundRobinAlgorithm

public StickyRoundRobinAlgorithm()

StickyRoundRobinAlgorithm

public StickyRoundRobinAlgorithm(ClusterableService primary)
Method Detail

selectService

public ClusterableService selectService(java.util.ArrayList services)
                                 throws java.rmi.RemoteException
Overrides:
selectService in class RoundRobinAlgorithm


Copyright � 2002 Macromedia Corporation. All Rights Reserved.