package foam.nanos.pool;

import foam.core.Agency;
import foam.core.ContextAgent;
import foam.core.ContextAgentRunnable;
import foam.core.X;
import java.util.LinkedList;
import java.util.Queue;

public class AgentAgency
  implements Agency
{
  Queue<Runnable> agents = new LinkedList<>();

  @Override
  public void submit(X x, ContextAgent agent, String description) {
    agents.add(new ContextAgentRunnable(x, agent, description));
  }

  public void execute() {
    while ( ! agents.isEmpty() ) {
      agents.remove().run();
    }
  }
}

@@ -1,8 +1,132 @@
+/**%0A * @license%0A * Copyright 2019 The FOAM Authors. All Rights Reserved.%0A * http://www.apache.org/licenses/LICENSE-2.0%0A */%0A%0A
 package 

Add copyright.