com.atlassian.bamboo.agent.elastic.server
Class ShutdownOrderComparator

java.lang.Object
  extended by com.atlassian.bamboo.agent.elastic.server.ShutdownOrderComparator
All Implemented Interfaces:
java.util.Comparator<RemoteElasticInstance>

public class ShutdownOrderComparator
extends java.lang.Object
implements java.util.Comparator<RemoteElasticInstance>

A compartator that will sort agents on the order which they should shutdown. Order is

  1. No agent found for RemoteElasticInstance
  2. BuildAgent.isRequestedToBeStopped() is true
  3. BuildAgent.isEnabled() is false (disabled agents)
  4. BuildAgent.getAgentStatus() 's index


Constructor Summary
ShutdownOrderComparator(LocalAgentManager localAgentManager)
           
 
Method Summary
 int compare(RemoteElasticInstance o1, RemoteElasticInstance o2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ShutdownOrderComparator

public ShutdownOrderComparator(LocalAgentManager localAgentManager)
Method Detail

compare

public int compare(@NotNull
                   RemoteElasticInstance o1,
                   @NotNull
                   RemoteElasticInstance o2)
Specified by:
compare in interface java.util.Comparator<RemoteElasticInstance>


Copyright © 2010 Atlassian. All Rights Reserved.