use of org.apache.sling.commons.scheduler.impl.QuartzScheduler in project sling by apache.
the class VirtualInstanceBuilder method getSingletonScheduler.
public static Scheduler getSingletonScheduler() throws Exception {
if (singletonScheduler != null) {
return singletonScheduler;
}
final Scheduler newscheduler = new QuartzScheduler();
final ThreadPoolManager tpm = new DefaultThreadPoolManager(null, null);
try {
PrivateAccessor.invoke(newscheduler, "bindThreadPoolManager", new Class[] { ThreadPoolManager.class }, new Object[] { tpm });
} catch (Throwable e1) {
org.junit.Assert.fail(e1.toString());
}
OSGiMock.activate(newscheduler);
singletonScheduler = newscheduler;
return singletonScheduler;
}
Aggregations