Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
poa-manager [2018/08/03 14:55] rafael [Implementation Details] |
poa-manager [2018/08/03 15:12] rafael [Usage] |
||
---|---|---|---|
Line 22: | Line 22: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | A cada intervalo intervalo de tempo predefinido, | ||
+ | |||
+ | Para evitar que a carga entre os GWs seja redistribuída em intervalos curtos demais, o parâmetro **DELAY_BETWEEN_TWO_LOAD_BALANCING_EXECUTIONS_IN_MILLIS** define o intervalo mínimo entre a realização de 2 balanceamentos de carga. | ||
+ | <file java PoAMan.java> | ||
+ | /** | ||
+ | * Checks if all Gateways are working and executes the load balancing algorithm | ||
+ | | ||
+ | * {@inheritDoc} | ||
+ | */ | ||
+ | @Override | ||
+ | public void run() { | ||
+ | System.out.println(" | ||
+ | |||
+ | this.detectFailedGateways(); | ||
+ | |||
+ | if (((System.currentTimeMillis() - this.lastLoadBalacingExecutionTime) > PoAMan.DELAY_BETWEEN_TWO_LOAD_BALANCING_EXECUTIONS_IN_MILLIS) | ||
+ | && (this.loadReportsByGateway.size() > 1)) { | ||
+ | |||
+ | List< | ||
+ | |||
+ | List< | ||
+ | |||
+ | if (privateMessageList.size() > 0) { | ||
+ | this.sendPrivateMessages(privateMessageList); | ||
+ | |||
+ | this.lastLoadBalacingExecutionTime = System.currentTimeMillis(); | ||
+ | } | ||
+ | |||
+ | } | ||
+ | }</ | ||
===== Architecture ===== | ===== Architecture ===== | ||
Descrever a arquitetura do componente. As principais classes e relações que sustentam o componente. | Descrever a arquitetura do componente. As principais classes e relações que sustentam o componente. |