import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.Executor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.argeo.security.ArgeoSecurityService;
import org.argeo.slc.dao.runtime.SlcAgentDescriptorDao;
import org.argeo.slc.runtime.SlcAgent;
import org.argeo.slc.runtime.SlcAgentDescriptor;
private final SlcAgentDescriptorDao slcAgentDescriptorDao;
private final SlcAgentFactory agentFactory;
- private ArgeoSecurityService securityService;
+ private Executor systemExecutor;
private Long pingCycle = 20000l;
// if (pingCycle > 0)
// new PingThread().start();
if (pingCycle > 0) {
- Thread authenticatedThread = new Thread(securityService
- .wrapWithSystemAuthentication(new AgentsPing()),
- "SLC Agents Ping");
+ Thread authenticatedThread = new Thread("SLC Agents Ping") {
+ public void run() {
+ systemExecutor.execute(new AgentsPing());
+ }
+ };
authenticatedThread.start();
}
this.pingCycle = pingCycle;
}
- public void setSecurityService(ArgeoSecurityService securityService) {
- this.securityService = securityService;
+ public void setSystemExecutor(Executor securityService) {
+ this.systemExecutor = securityService;
}
protected class AgentsPing implements Runnable {
agentIds.add(ad.getUuid());
if (log.isTraceEnabled())
- log.debug("Ping " + agentIds.size() + " agent.");
+ log.trace("Ping " + agentIds.size() + " agent(s).");
for (String agentId : agentIds) {
SlcAgent agent = agentFactory.getAgent(agentId);
if (!agent.ping()) {