mirror of
https://github.com/hapifhir/hapi-fhir.git
synced 2025-02-17 02:15:22 +00:00
merge two beans into one
This commit is contained in:
parent
6f9cd56c81
commit
a71eb039e3
@ -36,7 +36,6 @@ import ca.uhn.fhir.jpa.subscription.module.channel.ISubscribableChannelFactory;
|
||||
import ca.uhn.fhir.jpa.subscription.module.matcher.ISubscriptionMatcher;
|
||||
import ca.uhn.fhir.jpa.subscription.module.matcher.InMemorySubscriptionMatcher;
|
||||
import ca.uhn.fhir.rest.server.interceptor.consent.IConsentContextServices;
|
||||
import ca.uhn.fhir.rest.server.sched.ISchedulerFactory;
|
||||
import ca.uhn.fhir.rest.server.sched.ISchedulerService;
|
||||
import org.hibernate.jpa.HibernatePersistenceProvider;
|
||||
import org.hl7.fhir.utilities.graphql.IGraphQLStorageServices;
|
||||
@ -251,12 +250,7 @@ public abstract class BaseConfig {
|
||||
|
||||
@Bean
|
||||
public ISchedulerService schedulerService() {
|
||||
return new SchedulerServiceImpl();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ISchedulerFactory schedulerFactory() {
|
||||
return new HapiSchedulerFactory();
|
||||
return new SchedulerServiceImpl(new HapiSchedulerFactory());
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
@ -65,8 +65,8 @@ public class SchedulerServiceImpl implements ISchedulerService, SmartLifecycle {
|
||||
private boolean myClusteredSchedulingEnabled;
|
||||
private AtomicBoolean myStopping = new AtomicBoolean(false);
|
||||
|
||||
@Autowired
|
||||
private ISchedulerFactory mySchedulerFactory;
|
||||
|
||||
private final ISchedulerFactory mySchedulerFactory;
|
||||
@Autowired
|
||||
private Environment myEnvironment;
|
||||
@Autowired
|
||||
@ -74,12 +74,18 @@ public class SchedulerServiceImpl implements ISchedulerService, SmartLifecycle {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param theSchedulerFactory
|
||||
*/
|
||||
public SchedulerServiceImpl() {
|
||||
public SchedulerServiceImpl(ISchedulerFactory theSchedulerFactory) {
|
||||
mySchedulerFactory = theSchedulerFactory;
|
||||
setLocalSchedulingEnabled(true);
|
||||
setClusteredSchedulingEnabled(true);
|
||||
}
|
||||
|
||||
public ISchedulerFactory getSchedulerFactory() {
|
||||
return mySchedulerFactory;
|
||||
}
|
||||
|
||||
public boolean isLocalSchedulingEnabled() {
|
||||
return myLocalSchedulingEnabled;
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package ca.uhn.fhir.jpa.sched;
|
||||
|
||||
import ca.uhn.fhir.jpa.model.sched.FireAtIntervalJob;
|
||||
import ca.uhn.fhir.rest.server.sched.ISchedulerFactory;
|
||||
import ca.uhn.fhir.rest.server.sched.ISchedulerService;
|
||||
import ca.uhn.fhir.rest.server.sched.ScheduledJobDefinition;
|
||||
import org.junit.After;
|
||||
@ -180,21 +179,14 @@ public class SchedulerServiceImplTest {
|
||||
sleepAtLeast(ourTaskDelay);
|
||||
ourCount++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
public static class TestConfiguration {
|
||||
|
||||
@Bean
|
||||
public ISchedulerService schedulerService() {
|
||||
return new SchedulerServiceImpl();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ISchedulerFactory schedulerFactory() {
|
||||
return new HapiSchedulerFactory();
|
||||
return new SchedulerServiceImpl(new HapiSchedulerFactory());
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
Loading…
x
Reference in New Issue
Block a user