public void shutdown() {
    shouldRun = false;
    agentThread.interrupt();
  }
The purpose of this class is to simulate the agent.
ambari-server/src/test/java/org/apache/ambari/server/agent/LocalAgentSimulator.java