Emergency fix.
Normally I'd write a test for this, but this startup behaviour is changing in my next PR.
This commit is contained in:
parent
17ac097050
commit
860a8fb7a6
|
@ -37,6 +37,7 @@ import java.util.Set;
|
||||||
public class SubscriptionInterceptorLoader {
|
public class SubscriptionInterceptorLoader {
|
||||||
private static final Logger ourLog = LoggerFactory.getLogger(SubscriptionInterceptorLoader.class);
|
private static final Logger ourLog = LoggerFactory.getLogger(SubscriptionInterceptorLoader.class);
|
||||||
|
|
||||||
|
// TODO KHS remove side-effects of autowiring these beans
|
||||||
private SubscriptionMatcherInterceptor mySubscriptionMatcherInterceptor;
|
private SubscriptionMatcherInterceptor mySubscriptionMatcherInterceptor;
|
||||||
private SubscriptionActivatingInterceptor mySubscriptionActivatingInterceptor;
|
private SubscriptionActivatingInterceptor mySubscriptionActivatingInterceptor;
|
||||||
|
|
||||||
|
@ -52,11 +53,16 @@ public class SubscriptionInterceptorLoader {
|
||||||
|
|
||||||
if (!supportedSubscriptionTypes.isEmpty()) {
|
if (!supportedSubscriptionTypes.isEmpty()) {
|
||||||
loadSubscriptions();
|
loadSubscriptions();
|
||||||
|
if (mySubscriptionActivatingInterceptor == null) {
|
||||||
|
mySubscriptionActivatingInterceptor = myAppicationContext.getBean(SubscriptionActivatingInterceptor.class);
|
||||||
|
}
|
||||||
ourLog.info("Registering subscription activating interceptor");
|
ourLog.info("Registering subscription activating interceptor");
|
||||||
myDaoConfig.registerInterceptor(mySubscriptionActivatingInterceptor);
|
myDaoConfig.registerInterceptor(mySubscriptionActivatingInterceptor);
|
||||||
}
|
}
|
||||||
if (myDaoConfig.isSubscriptionMatchingEnabled()) {
|
if (myDaoConfig.isSubscriptionMatchingEnabled()) {
|
||||||
|
if (mySubscriptionMatcherInterceptor == null) {
|
||||||
|
mySubscriptionMatcherInterceptor = myAppicationContext.getBean(SubscriptionMatcherInterceptor.class);
|
||||||
|
}
|
||||||
ourLog.info("Registering subscription matcher interceptor");
|
ourLog.info("Registering subscription matcher interceptor");
|
||||||
myDaoConfig.registerInterceptor(mySubscriptionMatcherInterceptor);
|
myDaoConfig.registerInterceptor(mySubscriptionMatcherInterceptor);
|
||||||
}
|
}
|
||||||
|
@ -67,14 +73,6 @@ public class SubscriptionInterceptorLoader {
|
||||||
// Load subscriptions into the SubscriptionRegistry
|
// Load subscriptions into the SubscriptionRegistry
|
||||||
myAppicationContext.getBean(SubscriptionLoader.class);
|
myAppicationContext.getBean(SubscriptionLoader.class);
|
||||||
ourLog.info("...{} subscriptions loaded", mySubscriptionRegistry.size());
|
ourLog.info("...{} subscriptions loaded", mySubscriptionRegistry.size());
|
||||||
|
|
||||||
// Once subscriptions have been loaded, now
|
|
||||||
if (mySubscriptionActivatingInterceptor == null) {
|
|
||||||
mySubscriptionActivatingInterceptor = myAppicationContext.getBean(SubscriptionActivatingInterceptor.class);
|
|
||||||
}
|
|
||||||
if (mySubscriptionMatcherInterceptor == null) {
|
|
||||||
mySubscriptionMatcherInterceptor = myAppicationContext.getBean(SubscriptionMatcherInterceptor.class);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
|
Loading…
Reference in New Issue