|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.psepr.jClient.SimpleRouterManager
public class SimpleRouterManager
Simple router manager that reads the list of routers from the configuration file and keeps connection information information in a file. Routers that have had previous successful connections are preferred next time.
| Constructor Summary | |
|---|---|
SimpleRouterManager()
|
|
| Method Summary | |
|---|---|
PsEPRRouter |
getNextRouterToTry()
Get the next router to try. |
PsEPRRouter |
getNextRouterToTryOld()
Get the next router to try. |
void |
routerFailed(PsEPRRouter rtr)
Called to say that a previously return PsEPRRouter couldn't be connected to. |
java.lang.String |
toXML()
output our nodes and status as XML |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleRouterManager()
| Method Detail |
|---|
public PsEPRRouter getNextRouterToTry()
getNextRouterToTry in interface RouterManagerRouterManager.getNextRouterToTry()public PsEPRRouter getNextRouterToTryOld()
Get the next router to try. This uses a 'weight' of each connection that remembers if we've had success here before or not. All routers start out equal. When a router is connected, it gets a positive count. When a router "fails", the weight is decremented. Over time, the good ones count up and the bad count down.
The 'touched' flag is used to keep track of using them all. Once all have been used, we clear touched and start over
RouterManager.getNextRouterToTry()public void routerFailed(PsEPRRouter rtr)
RouterManager
routerFailed in interface RouterManagerrtr - previously returned (from getNextRouterToTry) routerRouterManager.routerFailed(org.psepr.jClient.PsEPRRouter)public java.lang.String toXML()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||