Make SubscriptionDeliveryHandlerFactory not abstract

This commit is contained in:
jamesagnew 2020-03-22 21:01:19 -04:00
parent f89661526c
commit 3f20f7b67f
2 changed files with 16 additions and 4 deletions

View File

@ -40,7 +40,12 @@ import ca.uhn.fhir.rest.server.interceptor.consent.IConsentContextServices;
import org.hibernate.jpa.HibernatePersistenceProvider;
import org.hl7.fhir.utilities.graphql.IGraphQLStorageServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Primary;
import org.springframework.core.env.Environment;
import org.springframework.core.task.AsyncTaskExecutor;
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;

View File

@ -31,13 +31,20 @@ import org.springframework.stereotype.Component;
import java.util.Optional;
@Component
public abstract class SubscriptionDeliveryHandlerFactory {
public class SubscriptionDeliveryHandlerFactory {
private IEmailSender myEmailSender;
@Lookup
protected abstract SubscriptionDeliveringEmailSubscriber getSubscriptionDeliveringEmailSubscriber(IEmailSender myEmailSender);
protected SubscriptionDeliveringEmailSubscriber getSubscriptionDeliveringEmailSubscriber(IEmailSender myEmailSender) {
// stub method since this is a @Lookup
throw new IllegalStateException();
}
@Lookup
protected abstract SubscriptionDeliveringRestHookSubscriber getSubscriptionDeliveringRestHookSubscriber();
protected SubscriptionDeliveringRestHookSubscriber getSubscriptionDeliveringRestHookSubscriber() {
// stub method since this is a @Lookup
throw new IllegalStateException();
}
public Optional<MessageHandler> createDeliveryHandler(CanonicalSubscriptionChannelType theChannelType) {
if (theChannelType == CanonicalSubscriptionChannelType.EMAIL) {