|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.hammurapi.util.LoadBalancer
public class LoadBalancer
Load balancer distributes work to other workers according to weights. The less the weight the more job worker is getting.
Constructor Summary | |
---|---|
LoadBalancer()
|
Method Summary | |
---|---|
void |
addWorker(Worker worker,
int weight)
|
boolean |
post(java.lang.Runnable job)
Gives job to worker |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoadBalancer()
Method Detail |
---|
public boolean post(java.lang.Runnable job)
Worker
post
in interface Worker
public void addWorker(Worker worker, int weight)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |