}
m_contextDir = new File(getWorkDir(), subDir);
m_contextDir.mkdirs();
cleanDir(m_contextDir);
AgentContextImpl context = new AgentContextImpl(m_contextDir);
for (Class<?> handlerClass : AgentContextImpl.KNOWN_HANDLERS) {
if (ScheduledExecutorService.class.equals(handlerClass)) {
// always inject a proper executor service that simply invokes synchronously...
context.setHandler(ScheduledExecutorService.class, new SynchronousExecutorService());
}
else {
setMockedHandler(context, handlerClass);
}
}