net.sf.j2ep.servers
Class RoundRobinCluster

java.lang.Object
  extended by net.sf.j2ep.servers.ServerContainerBase
      extended by net.sf.j2ep.servers.ClusterContainer
          extended by net.sf.j2ep.servers.RoundRobinCluster
All Implemented Interfaces:
java.util.EventListener, ServerContainer, ServerStatusListener

public class RoundRobinCluster
extends ClusterContainer

A cluster using round-robin to get the next server in the cluster.

Author:
Anders Nyman

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.j2ep.servers.ClusterContainer
ClusterContainer.ClusteredServer
 
Field Summary
 
Fields inherited from class net.sf.j2ep.servers.ClusterContainer
servers
 
Constructor Summary
RoundRobinCluster()
          Creates a new round-robin cluster
 
Method Summary
protected  ClusterContainer.ClusteredServer createNewServer(java.lang.String domainName, java.lang.String directory)
          Will create a new server based on the domainName and the directory.
protected  ClusterContainer.ClusteredServer getNextServer()
          Returns the next in the cluster.
 
Methods inherited from class net.sf.j2ep.servers.ClusterContainer
addServer, getServer, getServerMapped, serverOffline, serverOnline
 
Methods inherited from class net.sf.j2ep.servers.ServerContainerBase
getRule, setRule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoundRobinCluster

public RoundRobinCluster()
Creates a new round-robin cluster

Method Detail

getNextServer

protected ClusterContainer.ClusteredServer getNextServer()
Returns the next in the cluster. The server if found using round-robin and checking that the server is marked as online.

Specified by:
getNextServer in class ClusterContainer
Returns:
The next server

createNewServer

protected ClusterContainer.ClusteredServer createNewServer(java.lang.String domainName,
                                                           java.lang.String directory)
Description copied from class: ClusterContainer
Will create a new server based on the domainName and the directory.

Specified by:
createNewServer in class ClusterContainer
Parameters:
domainName - The domain
directory - The directory
Returns:
The created server
See Also:
ClusterContainer.createNewServer(java.lang.String, java.lang.String)