org.objectweb.proactive.p2p.loadbalancer
Class P2PLoadBalancer

java.lang.Object
  extended by org.objectweb.proactive.loadbalancing.LoadBalancer
      extended by org.objectweb.proactive.p2p.loadbalancer.P2PLoadBalancer
All Implemented Interfaces:
Active, ProActiveInternalObject, RunActive

public class P2PLoadBalancer
extends LoadBalancer
implements RunActive, ProActiveInternalObject


Field Summary
protected  java.util.Vector acquaintances
           
protected  java.lang.String balancerName
           
protected  java.util.Vector forBalancing
           
protected  java.util.Vector forStealing
           
protected  P2PLoadBalancer myThis
           
protected  P2PService p2pService
           
protected  java.util.Random randomizer
           
protected  double ranking
           
 
Fields inherited from class org.objectweb.proactive.loadbalancing.LoadBalancer
informationRecover, lm, loadBalancers, logger, metric, myNode
 
Constructor Summary
P2PLoadBalancer()
           
 
Method Summary
protected  void addToBalanceList(int n)
           
protected  void addToStealList(int n)
           
protected  void getActiveObjectsFrom(P2PLoadBalancer remoteBalancer, double remoteRanking)
           
 double getRanking()
           
 void init()
           
 void killMePlease()
           
protected  long ping(java.lang.String nodeAddress)
           
 void runActivity(Body body)
          Runs the activity of the active object.
 void sendActiveObjectsTo(Node remoteNode, double remoteRanking)
           
 void startBalancing()
          This method use the P2P infrastructure to search nodes which can receive its active objects.
 void stealWork()
          This method use the P2P infrastructure to search nodes which I can steal work.
 
Methods inherited from class org.objectweb.proactive.loadbalancing.LoadBalancer
addNewBalancer, getActiveObjectsFrom, getName, init, notifyLoadBalancers, sendActiveObjectsTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

balancerName

protected java.lang.String balancerName

randomizer

protected java.util.Random randomizer

p2pService

protected P2PService p2pService

acquaintances

protected java.util.Vector acquaintances

forBalancing

protected java.util.Vector forBalancing

forStealing

protected java.util.Vector forStealing

myThis

protected P2PLoadBalancer myThis

ranking

protected double ranking
Constructor Detail

P2PLoadBalancer

public P2PLoadBalancer()
Method Detail

addToBalanceList

protected void addToBalanceList(int n)

addToStealList

protected void addToStealList(int n)

getRanking

public double getRanking()

ping

protected long ping(java.lang.String nodeAddress)

startBalancing

public void startBalancing()
This method use the P2P infrastructure to search nodes which can receive its active objects. Method extended from LoadBalancer class.

Overrides:
startBalancing in class LoadBalancer

getActiveObjectsFrom

protected void getActiveObjectsFrom(P2PLoadBalancer remoteBalancer,
                                    double remoteRanking)

stealWork

public void stealWork()
This method use the P2P infrastructure to search nodes which I can steal work. Method extended from LoadBalancer class.

Overrides:
stealWork in class LoadBalancer

sendActiveObjectsTo

public void sendActiveObjectsTo(Node remoteNode,
                                double remoteRanking)
Overrides:
sendActiveObjectsTo in class LoadBalancer

runActivity

public void runActivity(Body body)
Description copied from interface: RunActive
Runs the activity of the active object.

Specified by:
runActivity in interface RunActive
Parameters:
body - the body of the active object being started

killMePlease

public void killMePlease()

init

public void init()


Copyright 2001-2007 INRIA All Rights Reserved.