poa-manager

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
poa-manager [2018/08/03 14:55]
rafael [Implementation Details]
poa-manager [2018/08/03 15:04]
rafael [Usage]
Line 22: Line 22:
 } }
 </file> </file>
 +
 +A cada intervalo
 +<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.loadReportsByGateway.size() " + this.loadReportsByGateway.size());
 +
 +    this.detectFailedGateways();
 +
 +    if (((System.currentTimeMillis() - this.lastLoadBalacingExecutionTime) > PoAMan.DELAY_BETWEEN_TWO_LOAD_BALANCING_EXECUTIONS_IN_MILLIS)
 +      && (this.loadReportsByGateway.size() > 1)) {
 +
 +      List<LoadReportTopicComparable> analysis = this.loadReportsAnalyzer.runAnalyzer(this.loadReportsByGateway);
 +
 +      List<PrivateMessage> privateMessageList = this.planningExecutor.RunPlanningExecutor(analysis, this.vehiclesByGateway);
 +
 +      if (privateMessageList.size() > 0) {
 +        this.sendPrivateMessages(privateMessageList);
 +
 +        this.lastLoadBalacingExecutionTime = System.currentTimeMillis();
 +      }
 +
 +    }
 +  }</file>
 ===== 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.
  • poa-manager.txt
  • Last modified: 2018/08/03 15:12
  • by rafael