jp.lang
Class ObjectDistributor

java.lang.Object
  extended byjp.lang.Distributor
      extended byjp.lang.ObjectDistributor
All Implemented Interfaces:
java.io.Serializable

public class ObjectDistributor
extends Distributor

ObjectDistributor implements the default object distribution strategy; it selects machines using this strategy: - if a machine's priority is NEVER, it is never chosen, - if a machine was the last machine, that was declared to be the prefered machine (ALWAYS), it is selected always - if a new machine's priority is set to ALWAYS, the former prefered machine's priority is reset to DEFAULT - if there is no prefered machine, then a random machine (with DEFAULT priority) is chosen

Since:
JP0.1
Author:
Matthias Zenger, Bernhard Haumacher
See Also:
Distributor, Serialized Form

Field Summary
 
Fields inherited from class jp.lang.Distributor
ALWAYS, DEFAULT, NEVER
 
Constructor Summary
ObjectDistributor()
           
 
Method Summary
 int getPriority(int target)
          get the current priority of a machine
 Distributor reset()
          reset all machine priorities to the default value (return this)
 Distributor setPriority(int target, int priority)
          set the priority of a machine (return this)
 int target(int jvmCnt, java.lang.String classname)
          return a target machine for class- or constructor-object of class
 void update()
          callback method that is invoked by the runtime system when runtime data changes
 
Methods inherited from class jp.lang.Distributor
loadDistributor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectDistributor

public ObjectDistributor()
Method Detail

update

public void update()
Description copied from class: Distributor
callback method that is invoked by the runtime system when runtime data changes

Overrides:
update in class Distributor

reset

public Distributor reset()
Description copied from class: Distributor
reset all machine priorities to the default value (return this)

Specified by:
reset in class Distributor

setPriority

public Distributor setPriority(int target,
                               int priority)
Description copied from class: Distributor
set the priority of a machine (return this)

Specified by:
setPriority in class Distributor

getPriority

public int getPriority(int target)
Description copied from class: Distributor
get the current priority of a machine

Specified by:
getPriority in class Distributor

target

public int target(int jvmCnt,
                  java.lang.String classname)
Description copied from class: Distributor
return a target machine for class- or constructor-object of class

Specified by:
target in class Distributor