Reduce postconstruct use (#4445)

This commit is contained in:
Ken Stevens 2023-01-21 00:37:58 -05:00 committed by GitHub
parent bf53a08b83
commit 5dda16d467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
113 changed files with 314 additions and 269 deletions

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId> <artifactId>hapi-fhir</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -0,0 +1,33 @@
package ca.uhn.fhir;
/*-
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 - 2023 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
/**
* Spring bean initialization constants.
*/
public interface IHapiBootOrder {
int ADD_JOB_DEFINITIONS = 100;
int REGISTER_INTERCEPTORS = 200;
int SUBSCRIPTION_MATCHING_CHANNEL_HANDLER = 300;
int AFTER_SUBSCRIPTION_INITIALIZED = 310;
}

View File

@ -456,8 +456,7 @@ public abstract class BaseInterceptorService<POINTCUT extends IPointcut> impleme
theInvokers.put((POINTCUT) nextPointcut, nextAddedHook); theInvokers.put((POINTCUT) nextPointcut, nextAddedHook);
} }
// Make sure we're always sorted according to the order declared in // Make sure we're always sorted according to the order declared in @Order
// @Order
for (IPointcut nextPointcut : theInvokers.keys()) { for (IPointcut nextPointcut : theInvokers.keys()) {
List<BaseInvoker> nextInvokerList = theInvokers.get((POINTCUT) nextPointcut); List<BaseInvoker> nextInvokerList = theInvokers.get((POINTCUT) nextPointcut);
nextInvokerList.sort(Comparator.naturalOrder()); nextInvokerList.sort(Comparator.naturalOrder());

View File

@ -4,14 +4,14 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-bom</artifactId> <artifactId>hapi-fhir-bom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>HAPI FHIR BOM</name> <name>HAPI FHIR BOM</name>
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId> <artifactId>hapi-fhir</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-cli</artifactId> <artifactId>hapi-fhir-cli</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../../hapi-deployable-pom</relativePath> <relativePath>../../hapi-deployable-pom</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId> <artifactId>hapi-fhir</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId> <artifactId>hapi-fhir</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -11,7 +11,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>
@ -87,6 +87,11 @@
<artifactId>jboss-jaxrs-api_2.1_spec</artifactId> <artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring_version}</version>
</dependency>
<!-- Unit test dependencies --> <!-- Unit test dependencies -->
<dependency> <dependency>
<groupId>com.fasterxml.woodstox</groupId> <groupId>com.fasterxml.woodstox</groupId>

View File

@ -46,8 +46,9 @@ import org.hl7.fhir.dstu2.hapi.rest.server.ServerConformanceProvider;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.r4.model.CapabilityStatement; import org.hl7.fhir.r4.model.CapabilityStatement;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import javax.annotation.PostConstruct;
import javax.ws.rs.GET; import javax.ws.rs.GET;
import javax.ws.rs.OPTIONS; import javax.ws.rs.OPTIONS;
import javax.ws.rs.Path; import javax.ws.rs.Path;
@ -132,11 +133,11 @@ public abstract class AbstractJaxRsConformanceProvider extends AbstractJaxRsProv
} }
/** /**
* This method will set the conformance during the postconstruct phase. The method {@link AbstractJaxRsConformanceProvider#getProviders()} is used to get all the resource providers include in the * This method will set the conformance during the Context Refreshed phase. The method {@link AbstractJaxRsConformanceProvider#getProviders()} is used to get all the resource providers include in the
* conformance * conformance
*/ */
@PostConstruct @EventListener(ContextRefreshedEvent.class)
protected synchronized void setUpPostConstruct() { protected synchronized void buildCapabilityStatement() {
if (myInitialized) { if (myInitialized) {
return; return;
} }
@ -211,7 +212,7 @@ public abstract class AbstractJaxRsConformanceProvider extends AbstractJaxRsProv
@GET @GET
@Path("/metadata") @Path("/metadata")
public Response conformance() throws IOException { public Response conformance() throws IOException {
setUpPostConstruct(); buildCapabilityStatement();
Builder request = getRequest(RequestTypeEnum.OPTIONS, RestOperationTypeEnum.METADATA); Builder request = getRequest(RequestTypeEnum.OPTIONS, RestOperationTypeEnum.METADATA);
JaxRsRequest requestDetails = request.build(); JaxRsRequest requestDetails = request.build();

View File

@ -16,7 +16,8 @@ import java.net.URI;
import java.util.Arrays; import java.util.Arrays;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
@ -99,7 +100,7 @@ public class AbstractJaxRsConformanceProviderDstu2Hl7OrgTest {
when(uriInfo.getRequestUri()).thenReturn(new URI(BASEURI + "/foo")); when(uriInfo.getRequestUri()).thenReturn(new URI(BASEURI + "/foo"));
result.setUriInfo(uriInfo); result.setUriInfo(uriInfo);
result.setHeaders(headers); result.setHeaders(headers);
result.setUpPostConstruct(); result.buildCapabilityStatement();
return result; return result;
} }

View File

@ -5,12 +5,12 @@ import ca.uhn.fhir.jaxrs.server.test.TestJaxRsDummyPatientProviderDstu2_1;
import ca.uhn.fhir.jaxrs.server.test.TestJaxRsMockPatientRestProviderDstu2_1; import ca.uhn.fhir.jaxrs.server.test.TestJaxRsMockPatientRestProviderDstu2_1;
import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.IResourceProvider;
import javax.ws.rs.core.MultivaluedMap;
import org.jboss.resteasy.specimpl.ResteasyHttpHeaders; import org.jboss.resteasy.specimpl.ResteasyHttpHeaders;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import javax.ws.rs.core.MultivaluedHashMap; import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo; import javax.ws.rs.core.UriInfo;
import java.net.URI; import java.net.URI;
@ -101,7 +101,7 @@ public class AbstractJaxRsConformanceProviderDstu2_1Test {
when(uriInfo.getRequestUri()).thenReturn(new URI(BASEURI + "/foo")); when(uriInfo.getRequestUri()).thenReturn(new URI(BASEURI + "/foo"));
result.setUriInfo(uriInfo); result.setUriInfo(uriInfo);
result.setHeaders(headers); result.setHeaders(headers);
result.setUpPostConstruct(); result.buildCapabilityStatement();
return result; return result;
} }

View File

@ -1,6 +1,7 @@
package ca.uhn.fhir.jaxrs.server; package ca.uhn.fhir.jaxrs.server;
import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.jaxrs.server.test.TestJaxRsDummyPatientProviderDstu3;
import ca.uhn.fhir.jaxrs.server.test.TestJaxRsMockPatientRestProviderDstu3; import ca.uhn.fhir.jaxrs.server.test.TestJaxRsMockPatientRestProviderDstu3;
import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.IResourceProvider;
@ -15,12 +16,11 @@ import java.net.URI;
import java.util.Arrays; import java.util.Arrays;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
import ca.uhn.fhir.jaxrs.server.test.TestJaxRsDummyPatientProviderDstu3;
public class AbstractJaxRsConformanceProviderDstu3Test { public class AbstractJaxRsConformanceProviderDstu3Test {
private static final String BASEURI = "http://basiuri"; private static final String BASEURI = "http://basiuri";
@ -100,7 +100,7 @@ public class AbstractJaxRsConformanceProviderDstu3Test {
when(uriInfo.getRequestUri()).thenReturn(new URI(BASEURI + "/foo")); when(uriInfo.getRequestUri()).thenReturn(new URI(BASEURI + "/foo"));
result.setUriInfo(uriInfo); result.setUriInfo(uriInfo);
result.setHeaders(headers); result.setHeaders(headers);
result.setUpPostConstruct(); result.buildCapabilityStatement();
return result; return result;
} }

View File

@ -16,7 +16,8 @@ import java.net.URI;
import java.util.Arrays; import java.util.Arrays;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
@ -99,7 +100,7 @@ public class AbstractJaxRsConformanceProviderR4Test {
when(uriInfo.getRequestUri()).thenReturn(new URI(BASEURI + "/foo")); when(uriInfo.getRequestUri()).thenReturn(new URI(BASEURI + "/foo"));
result.setUriInfo(uriInfo); result.setUriInfo(uriInfo);
result.setHeaders(headers); result.setHeaders(headers);
result.setUpPostConstruct(); result.buildCapabilityStatement();
return result; return result;
} }

View File

@ -15,7 +15,8 @@ import java.net.URI;
import java.util.Arrays; import java.util.Arrays;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
@ -98,7 +99,7 @@ public class AbstractJaxRsConformanceProviderTest {
when(uriInfo.getRequestUri()).thenReturn(new URI(BASEURI + "/foo")); when(uriInfo.getRequestUri()).thenReturn(new URI(BASEURI + "/foo"));
result.setUriInfo(uriInfo); result.setUriInfo(uriInfo);
result.setHeaders(headers); result.setHeaders(headers);
result.setUpPostConstruct(); result.buildCapabilityStatement();
return result; return result;
} }

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -296,8 +296,8 @@ public class JpaConfig {
} }
@Bean @Bean
public MemoryCacheService memoryCacheService() { public MemoryCacheService memoryCacheService(DaoConfig theDaoConfig) {
return new MemoryCacheService(); return new MemoryCacheService(theDaoConfig);
} }
@Bean @Bean

View File

@ -24,6 +24,7 @@ import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport;
import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.context.support.IValidationSupport;
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.dao.JpaPersistedResourceValidationSupport; import ca.uhn.fhir.jpa.dao.JpaPersistedResourceValidationSupport;
import ca.uhn.fhir.jpa.validation.JpaValidationSupportChain; import ca.uhn.fhir.jpa.validation.JpaValidationSupportChain;
import ca.uhn.fhir.jpa.validation.ValidatorPolicyAdvisor; import ca.uhn.fhir.jpa.validation.ValidatorPolicyAdvisor;
@ -56,10 +57,10 @@ public class ValidationSupportConfig {
} }
@Bean(name = "myInstanceValidator") @Bean(name = "myInstanceValidator")
public IInstanceValidatorModule instanceValidator(FhirContext theFhirContext, CachingValidationSupport theCachingValidationSupport, ValidationSupportChain theValidationSupportChain) { public IInstanceValidatorModule instanceValidator(FhirContext theFhirContext, CachingValidationSupport theCachingValidationSupport, ValidationSupportChain theValidationSupportChain, IValidationSupport theValidationSupport, DaoRegistry theDaoRegistry) {
if (theFhirContext.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.DSTU3)) { if (theFhirContext.getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.DSTU3)) {
FhirInstanceValidator val = new FhirInstanceValidator(theCachingValidationSupport); FhirInstanceValidator val = new FhirInstanceValidator(theCachingValidationSupport);
val.setValidatorResourceFetcher(jpaValidatorResourceFetcher()); val.setValidatorResourceFetcher(jpaValidatorResourceFetcher(theFhirContext, theValidationSupport, theDaoRegistry));
val.setValidatorPolicyAdvisor(jpaValidatorPolicyAdvisor()); val.setValidatorPolicyAdvisor(jpaValidatorPolicyAdvisor());
val.setBestPracticeWarningLevel(BestPracticeWarningLevel.Warning); val.setBestPracticeWarningLevel(BestPracticeWarningLevel.Warning);
val.setValidationSupport(theCachingValidationSupport); val.setValidationSupport(theCachingValidationSupport);
@ -74,8 +75,8 @@ public class ValidationSupportConfig {
@Bean @Bean
@Lazy @Lazy
public ValidatorResourceFetcher jpaValidatorResourceFetcher() { public ValidatorResourceFetcher jpaValidatorResourceFetcher(FhirContext theFhirContext, IValidationSupport theValidationSupport, DaoRegistry theDaoRegistry) {
return new ValidatorResourceFetcher(); return new ValidatorResourceFetcher(theFhirContext, theValidationSupport, theDaoRegistry);
} }
@Bean @Bean

View File

@ -30,7 +30,6 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.annotation.PostConstruct;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext; import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceContextType; import javax.persistence.PersistenceContextType;
@ -95,11 +94,6 @@ public abstract class BaseHapiFhirSystemDao<T extends IBaseBundle, MT> extends B
myTransactionProcessor = theTransactionProcessor; myTransactionProcessor = theTransactionProcessor;
} }
@PostConstruct
public void start() {
myTransactionProcessor.setDao(this);
}
@Override @Override
@Transactional(propagation = Propagation.NEVER) @Transactional(propagation = Propagation.NEVER)
public ExpungeOutcome expunge(ExpungeOptions theExpungeOptions, RequestDetails theRequestDetails) { public ExpungeOutcome expunge(ExpungeOptions theExpungeOptions, RequestDetails theRequestDetails) {

View File

@ -28,19 +28,12 @@ import org.hl7.fhir.dstu3.model.Bundle;
import org.hl7.fhir.dstu3.model.Meta; import org.hl7.fhir.dstu3.model.Meta;
import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseBundle;
import javax.annotation.PostConstruct;
import javax.persistence.TypedQuery; import javax.persistence.TypedQuery;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
public class FhirSystemDaoDstu3 extends BaseHapiFhirSystemDao<Bundle, Meta> { public class FhirSystemDaoDstu3 extends BaseHapiFhirSystemDao<Bundle, Meta> {
@Override
@PostConstruct
public void start() {
super.start();
}
@Override @Override
public Meta metaGetOperation(RequestDetails theRequestDetails) { public Meta metaGetOperation(RequestDetails theRequestDetails) {
String sql = "SELECT d FROM TagDefinition d WHERE d.myId IN (SELECT DISTINCT t.myTagId FROM ResourceTag t)"; String sql = "SELECT d FROM TagDefinition d WHERE d.myId IN (SELECT DISTINCT t.myTagId FROM ResourceTag t)";

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -8,10 +8,8 @@ import ca.uhn.fhir.mdm.api.IMdmSettings;
import ca.uhn.fhir.mdm.log.Logs; import ca.uhn.fhir.mdm.log.Logs;
import com.google.common.annotations.VisibleForTesting; import com.google.common.annotations.VisibleForTesting;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy; import javax.annotation.PreDestroy;
/*- /*-
@ -38,17 +36,22 @@ import javax.annotation.PreDestroy;
public class MdmQueueConsumerLoader { public class MdmQueueConsumerLoader {
private static final Logger ourLog = Logs.getMdmTroubleshootingLog(); private static final Logger ourLog = Logs.getMdmTroubleshootingLog();
@Autowired private final IChannelFactory myChannelFactory;
private MdmMessageHandler myMdmMessageHandler; private final IMdmSettings myMdmSettings;
@Autowired private final MdmMessageHandler myMdmMessageHandler;
private IChannelFactory myChannelFactory;
@Autowired
private IMdmSettings myMdmSettings;
protected IChannelReceiver myMdmChannel; protected IChannelReceiver myMdmChannel;
@PostConstruct public MdmQueueConsumerLoader(IChannelFactory theChannelFactory, IMdmSettings theMdmSettings, MdmMessageHandler theMdmMessageHandler) {
public void startListeningToMdmChannel() { myChannelFactory = theChannelFactory;
myMdmSettings = theMdmSettings;
myMdmMessageHandler = theMdmMessageHandler;
startListeningToMdmChannel();
}
private void startListeningToMdmChannel() {
if (myMdmChannel == null) { if (myMdmChannel == null) {
ChannelConsumerSettings config = new ChannelConsumerSettings(); ChannelConsumerSettings config = new ChannelConsumerSettings();

View File

@ -27,7 +27,6 @@ import ca.uhn.fhir.jpa.mdm.broker.MdmMessageHandler;
import ca.uhn.fhir.jpa.mdm.broker.MdmMessageKeySvc; import ca.uhn.fhir.jpa.mdm.broker.MdmMessageKeySvc;
import ca.uhn.fhir.jpa.mdm.broker.MdmQueueConsumerLoader; import ca.uhn.fhir.jpa.mdm.broker.MdmQueueConsumerLoader;
import ca.uhn.fhir.jpa.mdm.dao.MdmLinkDaoSvc; import ca.uhn.fhir.jpa.mdm.dao.MdmLinkDaoSvc;
import ca.uhn.fhir.mdm.dao.MdmLinkFactory;
import ca.uhn.fhir.jpa.mdm.svc.GoldenResourceMergerSvcImpl; import ca.uhn.fhir.jpa.mdm.svc.GoldenResourceMergerSvcImpl;
import ca.uhn.fhir.jpa.mdm.svc.GoldenResourceSearchSvcImpl; import ca.uhn.fhir.jpa.mdm.svc.GoldenResourceSearchSvcImpl;
import ca.uhn.fhir.jpa.mdm.svc.IMdmModelConverterSvc; import ca.uhn.fhir.jpa.mdm.svc.IMdmModelConverterSvc;
@ -52,6 +51,7 @@ import ca.uhn.fhir.jpa.mdm.svc.candidate.MdmCandidateSearchSvc;
import ca.uhn.fhir.jpa.mdm.svc.candidate.MdmGoldenResourceFindingSvc; import ca.uhn.fhir.jpa.mdm.svc.candidate.MdmGoldenResourceFindingSvc;
import ca.uhn.fhir.jpa.mdm.util.MdmPartitionHelper; import ca.uhn.fhir.jpa.mdm.util.MdmPartitionHelper;
import ca.uhn.fhir.jpa.partition.IRequestPartitionHelperSvc; import ca.uhn.fhir.jpa.partition.IRequestPartitionHelperSvc;
import ca.uhn.fhir.jpa.subscription.channel.api.IChannelFactory;
import ca.uhn.fhir.mdm.api.IGoldenResourceMergerSvc; import ca.uhn.fhir.mdm.api.IGoldenResourceMergerSvc;
import ca.uhn.fhir.mdm.api.IMdmControllerSvc; import ca.uhn.fhir.mdm.api.IMdmControllerSvc;
import ca.uhn.fhir.mdm.api.IMdmLinkCreateSvc; import ca.uhn.fhir.mdm.api.IMdmLinkCreateSvc;
@ -63,6 +63,7 @@ import ca.uhn.fhir.mdm.api.IMdmSettings;
import ca.uhn.fhir.mdm.api.IMdmSurvivorshipService; import ca.uhn.fhir.mdm.api.IMdmSurvivorshipService;
import ca.uhn.fhir.mdm.batch2.MdmBatch2Config; import ca.uhn.fhir.mdm.batch2.MdmBatch2Config;
import ca.uhn.fhir.mdm.dao.IMdmLinkImplFactory; import ca.uhn.fhir.mdm.dao.IMdmLinkImplFactory;
import ca.uhn.fhir.mdm.dao.MdmLinkFactory;
import ca.uhn.fhir.mdm.interceptor.IMdmStorageInterceptor; import ca.uhn.fhir.mdm.interceptor.IMdmStorageInterceptor;
import ca.uhn.fhir.mdm.interceptor.MdmStorageInterceptor; import ca.uhn.fhir.mdm.interceptor.MdmStorageInterceptor;
import ca.uhn.fhir.mdm.log.Logs; import ca.uhn.fhir.mdm.log.Logs;
@ -93,8 +94,8 @@ public class MdmConsumerConfig {
IMdmSurvivorshipService mdmSurvivorshipService() { return new MdmSurvivorshipSvcImpl(); } IMdmSurvivorshipService mdmSurvivorshipService() { return new MdmSurvivorshipSvcImpl(); }
@Bean @Bean
MdmQueueConsumerLoader mdmQueueConsumerLoader() { MdmQueueConsumerLoader mdmQueueConsumerLoader(IChannelFactory theChannelFactory, IMdmSettings theMdmSettings, MdmMessageHandler theMdmMessageHandler) {
return new MdmQueueConsumerLoader(); return new MdmQueueConsumerLoader(theChannelFactory, theMdmSettings, theMdmMessageHandler);
} }
@Bean @Bean

View File

@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.mdm.config;
* #L% * #L%
*/ */
import ca.uhn.fhir.IHapiBootOrder;
import ca.uhn.fhir.mdm.api.IMdmSettings; import ca.uhn.fhir.mdm.api.IMdmSettings;
import ca.uhn.fhir.mdm.provider.MdmProviderLoader; import ca.uhn.fhir.mdm.provider.MdmProviderLoader;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -44,7 +45,7 @@ public class MdmLoader {
@EventListener(classes = {ContextRefreshedEvent.class}) @EventListener(classes = {ContextRefreshedEvent.class})
// This @Order is here to ensure that MatchingQueueSubscriberLoader has initialized before we initialize this. // This @Order is here to ensure that MatchingQueueSubscriberLoader has initialized before we initialize this.
// Otherwise the MDM subscriptions won't get loaded into the SubscriptionRegistry // Otherwise the MDM subscriptions won't get loaded into the SubscriptionRegistry
@Order @Order(IHapiBootOrder.AFTER_SUBSCRIPTION_INITIALIZED)
public void updateSubscriptions() { public void updateSubscriptions() {
if (!myMdmSettings.isEnabled()) { if (!myMdmSettings.isEnabled()) {
return; return;

View File

@ -23,11 +23,11 @@ package ca.uhn.fhir.jpa.mdm.svc.candidate;
import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.interceptor.model.RequestPartitionId;
import ca.uhn.fhir.jpa.api.dao.DaoRegistry; import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
import ca.uhn.fhir.mdm.svc.MdmSearchParamSvc;
import ca.uhn.fhir.rest.api.server.SystemRequestDetails;
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import ca.uhn.fhir.mdm.api.IMdmSettings; import ca.uhn.fhir.mdm.api.IMdmSettings;
import ca.uhn.fhir.mdm.svc.MdmSearchParamSvc;
import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.api.server.SystemRequestDetails;
import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IAnyResource;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -86,7 +86,7 @@ public class CandidateSearcher {
} }
public static String idOrType(IAnyResource theResource, String theResourceType) { public static String idOrType(IAnyResource theResource, String theResourceType) {
if (theResource.getIdElement() == null) { if (theResource.getIdElement() == null || theResource.getIdElement().isEmpty()) {
return theResourceType; return theResourceType;
} }
return theResource.getIdElement().toUnqualifiedVersionless().toString(); return theResource.getIdElement().toUnqualifiedVersionless().toString();

View File

@ -1,8 +1,6 @@
package ca.uhn.fhir.jpa.mdm.provider; package ca.uhn.fhir.jpa.mdm.provider;
import ca.uhn.fhir.batch2.api.IJobCoordinator;
import ca.uhn.fhir.jpa.mdm.BaseMdmR4Test; import ca.uhn.fhir.jpa.mdm.BaseMdmR4Test;
import ca.uhn.fhir.jpa.partition.IRequestPartitionHelperSvc;
import ca.uhn.fhir.jpa.test.Batch2JobHelper; import ca.uhn.fhir.jpa.test.Batch2JobHelper;
import ca.uhn.fhir.mdm.api.IMdmControllerSvc; import ca.uhn.fhir.mdm.api.IMdmControllerSvc;
import ca.uhn.fhir.mdm.api.IMdmSubmitSvc; import ca.uhn.fhir.mdm.api.IMdmSubmitSvc;
@ -42,10 +40,6 @@ public abstract class BaseProviderR4Test extends BaseMdmR4Test {
@Autowired @Autowired
MessageHelper myMessageHelper; MessageHelper myMessageHelper;
@Autowired
private IJobCoordinator myJobCoordinator;
@Autowired
private IRequestPartitionHelperSvc myRequestPartitionHelperSvc;
private String defaultScript; private String defaultScript;
protected void setMdmRuleJson(String theString) throws IOException { protected void setMdmRuleJson(String theString) throws IOException {
@ -54,13 +48,12 @@ public abstract class BaseProviderR4Test extends BaseMdmR4Test {
String json = IOUtils.toString(resource.getInputStream(), Charsets.UTF_8); String json = IOUtils.toString(resource.getInputStream(), Charsets.UTF_8);
myMdmSettings.setEnabled(true); myMdmSettings.setEnabled(true);
myMdmSettings.setScriptText(json); myMdmSettings.setScriptText(json);
myMdmResourceMatcherSvc.init(); myMdmResourceMatcherSvc.setMdmSettings(myMdmSettings);
} }
@BeforeEach @BeforeEach
public void before() throws Exception { public void before() throws Exception {
myMdmProvider = new MdmProviderDstu3Plus(myFhirContext, myMdmControllerSvc, myMdmHelper, myMdmSubmitSvc, myMdmSettings); myMdmProvider = new MdmProviderDstu3Plus(myFhirContext, myMdmControllerSvc, myMdmHelper, myMdmSubmitSvc, myMdmSettings);
// FhirContext theFhirContext, IJobCoordinator theJobCoordinator, IRequestPartitionHelperSvc theRequestPartitionHelperSvc
defaultScript = myMdmSettings.getScriptText(); defaultScript = myMdmSettings.getScriptText();
} }
@ -69,7 +62,7 @@ public abstract class BaseProviderR4Test extends BaseMdmR4Test {
public void after() throws IOException { public void after() throws IOException {
super.after(); super.after();
myMdmSettings.setScriptText(defaultScript); myMdmSettings.setScriptText(defaultScript);
myMdmResourceMatcherSvc.init();// This bugger creates new objects from the beans and then ignores them. myMdmResourceMatcherSvc.setMdmSettings(myMdmSettings);
} }
protected void clearMdmLinks() { protected void clearMdmLinks() {

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.cache;
* #L% * #L%
*/ */
import ca.uhn.fhir.IHapiBootOrder;
import ca.uhn.fhir.interceptor.api.Hook; import ca.uhn.fhir.interceptor.api.Hook;
import ca.uhn.fhir.interceptor.api.IInterceptorService; import ca.uhn.fhir.interceptor.api.IInterceptorService;
import ca.uhn.fhir.interceptor.api.Pointcut; import ca.uhn.fhir.interceptor.api.Pointcut;
@ -46,7 +47,7 @@ public class ResourceChangeListenerRegistryInterceptor {
@EventListener(classes = {ContextRefreshedEvent.class}) @EventListener(classes = {ContextRefreshedEvent.class})
@Order @Order(IHapiBootOrder.REGISTER_INTERCEPTORS)
public void start() { public void start() {
myInterceptorBroadcaster.registerInterceptor(this); myInterceptorBroadcaster.registerInterceptor(this);
} }

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -1,5 +1,6 @@
package ca.uhn.fhir.jpa.subscription.match.matcher.subscriber; package ca.uhn.fhir.jpa.subscription.match.matcher.subscriber;
import ca.uhn.fhir.IHapiBootOrder;
import ca.uhn.fhir.jpa.subscription.channel.api.IChannelReceiver; import ca.uhn.fhir.jpa.subscription.channel.api.IChannelReceiver;
import ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionChannelFactory; import ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionChannelFactory;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -7,6 +8,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import javax.annotation.PreDestroy; import javax.annotation.PreDestroy;
@ -44,8 +46,9 @@ public class MatchingQueueSubscriberLoader {
@Autowired @Autowired
private SubscriptionActivatingSubscriber mySubscriptionActivatingSubscriber; private SubscriptionActivatingSubscriber mySubscriptionActivatingSubscriber;
@EventListener(classes = {ContextRefreshedEvent.class}) @EventListener(ContextRefreshedEvent.class)
public void handleContextRefreshEvent() { @Order(IHapiBootOrder.SUBSCRIPTION_MATCHING_CHANNEL_HANDLER)
public void subscribeToMatchingChannel() {
if (myMatchingChannel == null) { if (myMatchingChannel == null) {
myMatchingChannel = mySubscriptionChannelFactory.newMatchingReceivingChannel(SUBSCRIPTION_MATCHING_CHANNEL_NAME, null); myMatchingChannel = mySubscriptionChannelFactory.newMatchingReceivingChannel(SUBSCRIPTION_MATCHING_CHANNEL_NAME, null);
} }

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -178,11 +178,9 @@ public class GiantTransactionPerfTest {
myHapiTransactionService.setTransactionManager(myTransactionManager); myHapiTransactionService.setTransactionManager(myTransactionManager);
myHapiTransactionService.setInterceptorBroadcaster(myInterceptorSvc); myHapiTransactionService.setInterceptorBroadcaster(myInterceptorSvc);
myHapiTransactionService.setRequestPartitionSvcForUnitTest(myRequestPartitionHelperSvc); myHapiTransactionService.setRequestPartitionSvcForUnitTest(myRequestPartitionHelperSvc);
myHapiTransactionService.start();
myTransactionProcessor = new TransactionProcessor(); myTransactionProcessor = new TransactionProcessor();
myTransactionProcessor.setContext(ourFhirContext); myTransactionProcessor.setContext(ourFhirContext);
myTransactionProcessor.setDao(mySystemDao);
myTransactionProcessor.setTxManager(myTransactionManager); myTransactionProcessor.setTxManager(myTransactionManager);
myTransactionProcessor.setEntityManagerForUnitTest(myEntityManager); myTransactionProcessor.setEntityManagerForUnitTest(myEntityManager);
myTransactionProcessor.setVersionAdapter(new TransactionProcessorVersionAdapterR4()); myTransactionProcessor.setVersionAdapter(new TransactionProcessorVersionAdapterR4());
@ -194,12 +192,10 @@ public class GiantTransactionPerfTest {
myTransactionProcessor.setIdHelperServiceForUnitTest(myIdHelperService); myTransactionProcessor.setIdHelperServiceForUnitTest(myIdHelperService);
myTransactionProcessor.setFhirContextForUnitTest(ourFhirContext); myTransactionProcessor.setFhirContextForUnitTest(ourFhirContext);
myTransactionProcessor.setApplicationContextForUnitTest(myAppCtx); myTransactionProcessor.setApplicationContextForUnitTest(myAppCtx);
myTransactionProcessor.start();
mySystemDao = new FhirSystemDaoR4(); mySystemDao = new FhirSystemDaoR4();
mySystemDao.setTransactionProcessorForUnitTest(myTransactionProcessor); mySystemDao.setTransactionProcessorForUnitTest(myTransactionProcessor);
mySystemDao.setDaoConfigForUnitTest(myDaoConfig); mySystemDao.setDaoConfigForUnitTest(myDaoConfig);
mySystemDao.start();
when(myAppCtx.getBean(eq(IInstanceValidatorModule.class))).thenReturn(myInstanceValidatorSvc); when(myAppCtx.getBean(eq(IInstanceValidatorModule.class))).thenReturn(myInstanceValidatorSvc);
when(myAppCtx.getBean(eq(IFhirSystemDao.class))).thenReturn(mySystemDao); when(myAppCtx.getBean(eq(IFhirSystemDao.class))).thenReturn(mySystemDao);

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -39,8 +39,7 @@ class MemoryCacheServiceTest {
public void setUp() { public void setUp() {
DaoConfig daoConfig = new DaoConfig(); DaoConfig daoConfig = new DaoConfig();
daoConfig.setMassIngestionMode(false); daoConfig.setMassIngestionMode(false);
mySvc = new MemoryCacheService(); mySvc = new MemoryCacheService(daoConfig);
mySvc.myDaoConfig = daoConfig;
} }
@Test @Test
@ -50,7 +49,6 @@ class MemoryCacheServiceTest {
String code = "t"; String code = "t";
MemoryCacheService.TagDefinitionCacheKey cacheKey = new MemoryCacheService.TagDefinitionCacheKey(type, system, code); MemoryCacheService.TagDefinitionCacheKey cacheKey = new MemoryCacheService.TagDefinitionCacheKey(type, system, code);
mySvc.start();
TagDefinition retVal = mySvc.getIfPresent(MemoryCacheService.CacheEnum.TAG_DEFINITION, cacheKey); TagDefinition retVal = mySvc.getIfPresent(MemoryCacheService.CacheEnum.TAG_DEFINITION, cacheKey);
assertThat(retVal, nullValue()); assertThat(retVal, nullValue());

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId> <artifactId>hapi-fhir</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -33,10 +33,8 @@ import ca.uhn.fhir.mdm.rules.json.MdmFieldMatchJson;
import ca.uhn.fhir.mdm.rules.json.MdmRulesJson; import ca.uhn.fhir.mdm.rules.json.MdmRulesJson;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -51,19 +49,22 @@ public class MdmResourceMatcherSvc {
private static final Logger ourLog = Logs.getMdmTroubleshootingLog(); private static final Logger ourLog = Logs.getMdmTroubleshootingLog();
private final FhirContext myFhirContext; private final FhirContext myFhirContext;
private final IMdmSettings myMdmSettings;
private MdmRulesJson myMdmRulesJson; private MdmRulesJson myMdmRulesJson;
private final List<MdmResourceFieldMatcher> myFieldMatchers = new ArrayList<>(); private final List<MdmResourceFieldMatcher> myFieldMatchers = new ArrayList<>();
@Autowired public MdmResourceMatcherSvc(FhirContext theFhirContext, IMdmSettings theMdmSettings) {
public MdmResourceMatcherSvc(FhirContext theFhirContext, IMdmSettings theMdmRules) {
myFhirContext = theFhirContext; myFhirContext = theFhirContext;
myMdmSettings = theMdmRules;
setMdmSettings(theMdmSettings);
} }
@PostConstruct public void setMdmSettings(IMdmSettings theMdmSettings) {
public void init() { myMdmRulesJson = theMdmSettings.getMdmRules();
myMdmRulesJson = myMdmSettings.getMdmRules();
addFieldMatchers();
}
private void addFieldMatchers() {
if (myMdmRulesJson == null) { if (myMdmRulesJson == null) {
throw new ConfigurationException(Msg.code(1521) + "Failed to load MDM Rules. If MDM is enabled, then MDM rules must be available in context."); throw new ConfigurationException(Msg.code(1521) + "Failed to load MDM Rules. If MDM is enabled, then MDM rules must be available in context.");
} }
@ -71,7 +72,6 @@ public class MdmResourceMatcherSvc {
for (MdmFieldMatchJson matchFieldJson : myMdmRulesJson.getMatchFields()) { for (MdmFieldMatchJson matchFieldJson : myMdmRulesJson.getMatchFields()) {
myFieldMatchers.add(new MdmResourceFieldMatcher( myFhirContext, matchFieldJson, myMdmRulesJson)); myFieldMatchers.add(new MdmResourceFieldMatcher( myFhirContext, matchFieldJson, myMdmRulesJson));
} }
} }
/** /**

View File

@ -35,9 +35,7 @@ public abstract class BaseR4Test {
} }
protected MdmResourceMatcherSvc buildMatcher(MdmRulesJson theMdmRulesJson) { protected MdmResourceMatcherSvc buildMatcher(MdmRulesJson theMdmRulesJson) {
MdmResourceMatcherSvc retval = new MdmResourceMatcherSvc(ourFhirContext, new MdmSettings(new MdmRuleValidator(ourFhirContext, mySearchParamRetriever)).setMdmRules(theMdmRulesJson)); return new MdmResourceMatcherSvc(ourFhirContext, new MdmSettings(new MdmRuleValidator(ourFhirContext, mySearchParamRetriever)).setMdmRules(theMdmRulesJson));
retval.init();
return retval;
} }
protected void assertMatch(MdmMatchResultEnum theExpectedMatchEnum, MdmMatchOutcome theMatchResult) { protected void assertMatch(MdmMatchResultEnum theExpectedMatchEnum, MdmMatchOutcome theMatchResult) {

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<artifactId>hapi-fhir-serviceloaders</artifactId> <artifactId>hapi-fhir-serviceloaders</artifactId>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<artifactId>hapi-fhir-serviceloaders</artifactId> <artifactId>hapi-fhir-serviceloaders</artifactId>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
@ -20,7 +20,7 @@
<dependency> <dependency>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-caching-api</artifactId> <artifactId>hapi-fhir-caching-api</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.ben-manes.caffeine</groupId> <groupId>com.github.ben-manes.caffeine</groupId>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<artifactId>hapi-fhir-serviceloaders</artifactId> <artifactId>hapi-fhir-serviceloaders</artifactId>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<artifactId>hapi-fhir</artifactId> <artifactId>hapi-fhir</artifactId>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>hapi-fhir</artifactId> <artifactId>hapi-fhir</artifactId>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-spring-boot-samples</artifactId> <artifactId>hapi-fhir-spring-boot-samples</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
</parent> </parent>
<artifactId>hapi-fhir-spring-boot-sample-client-apache</artifactId> <artifactId>hapi-fhir-spring-boot-sample-client-apache</artifactId>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-spring-boot-samples</artifactId> <artifactId>hapi-fhir-spring-boot-samples</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
</parent> </parent>
<artifactId>hapi-fhir-spring-boot-sample-client-okhttp</artifactId> <artifactId>hapi-fhir-spring-boot-sample-client-okhttp</artifactId>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-spring-boot-samples</artifactId> <artifactId>hapi-fhir-spring-boot-samples</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
</parent> </parent>
<artifactId>hapi-fhir-spring-boot-sample-server-jersey</artifactId> <artifactId>hapi-fhir-spring-boot-sample-server-jersey</artifactId>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-spring-boot</artifactId> <artifactId>hapi-fhir-spring-boot</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
</parent> </parent>
<artifactId>hapi-fhir-spring-boot-samples</artifactId> <artifactId>hapi-fhir-spring-boot-samples</artifactId>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId> <artifactId>hapi-fhir</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -20,14 +20,17 @@ package ca.uhn.fhir.batch2.config;
* #L% * #L%
*/ */
import ca.uhn.fhir.IHapiBootOrder;
import ca.uhn.fhir.batch2.coordinator.JobDefinitionRegistry; import ca.uhn.fhir.batch2.coordinator.JobDefinitionRegistry;
import ca.uhn.fhir.batch2.model.JobDefinition; import ca.uhn.fhir.batch2.model.JobDefinition;
import ca.uhn.fhir.jpa.batch.log.Logs; import ca.uhn.fhir.jpa.batch.log.Logs;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import javax.annotation.PostConstruct;
import java.util.Map; import java.util.Map;
public class Batch2JobRegisterer { public class Batch2JobRegisterer {
@ -37,7 +40,12 @@ public class Batch2JobRegisterer {
private ApplicationContext myApplicationContext; private ApplicationContext myApplicationContext;
@PostConstruct // The timing of this call is sensitive. It needs to be called after all the job definition beans have been created
// but before any jobs are run. E.g. ValidationDataInitializerSvcImpl can start a REINDEX job, so we use an EventListener
// so we know all the JobDefinition beans have been created, but we use @Order(IHapiBootOrder.ADD_JOB_DEFINITIONS) to ensure it is called
// before any other EventListeners that might start a job.
@EventListener(classes = ContextRefreshedEvent.class)
@Order(IHapiBootOrder.ADD_JOB_DEFINITIONS)
public void start() { public void start() {
Map<String, JobDefinition> batchJobs = myApplicationContext.getBeansOfType(JobDefinition.class); Map<String, JobDefinition> batchJobs = myApplicationContext.getBeansOfType(JobDefinition.class);
JobDefinitionRegistry jobRegistry = myApplicationContext.getBean(JobDefinitionRegistry.class); JobDefinitionRegistry jobRegistry = myApplicationContext.getBean(JobDefinitionRegistry.class);

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -24,6 +24,7 @@ import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.context.support.IValidationSupport;
import ca.uhn.fhir.cr.common.CodeCacheResourceChangeListener; import ca.uhn.fhir.cr.common.CodeCacheResourceChangeListener;
import ca.uhn.fhir.cr.common.CqlExceptionHandlingInterceptor;
import ca.uhn.fhir.cr.common.CqlForkJoinWorkerThreadFactory; import ca.uhn.fhir.cr.common.CqlForkJoinWorkerThreadFactory;
import ca.uhn.fhir.cr.common.ElmCacheResourceChangeListener; import ca.uhn.fhir.cr.common.ElmCacheResourceChangeListener;
import ca.uhn.fhir.cr.common.HapiFhirDal; import ca.uhn.fhir.cr.common.HapiFhirDal;
@ -36,12 +37,12 @@ import ca.uhn.fhir.cr.common.ILibraryLoaderFactory;
import ca.uhn.fhir.cr.common.ILibraryManagerFactory; import ca.uhn.fhir.cr.common.ILibraryManagerFactory;
import ca.uhn.fhir.cr.common.ILibrarySourceProviderFactory; import ca.uhn.fhir.cr.common.ILibrarySourceProviderFactory;
import ca.uhn.fhir.cr.common.ITerminologyProviderFactory; import ca.uhn.fhir.cr.common.ITerminologyProviderFactory;
import ca.uhn.fhir.cr.common.CqlExceptionHandlingInterceptor;
import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.jpa.api.dao.DaoRegistry; import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoValueSet; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoValueSet;
import ca.uhn.fhir.jpa.cache.IResourceChangeListenerRegistry; import ca.uhn.fhir.jpa.cache.IResourceChangeListenerRegistry;
import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
import org.cqframework.cql.cql2elm.CqlTranslatorOptions; import org.cqframework.cql.cql2elm.CqlTranslatorOptions;
import org.cqframework.cql.cql2elm.LibraryManager; import org.cqframework.cql.cql2elm.LibraryManager;
import org.cqframework.cql.cql2elm.LibrarySourceProvider; import org.cqframework.cql.cql2elm.LibrarySourceProvider;
@ -99,8 +100,8 @@ public abstract class BaseClinicalReasoningConfig {
} }
@Bean @Bean
CrProviderLoader cqlProviderLoader() { CrProviderLoader cqlProviderLoader(FhirContext theFhirContext, ResourceProviderFactory theResourceProviderFactory, CrProviderFactory theCqlProviderFactory) {
return new CrProviderLoader(); return new CrProviderLoader(theFhirContext, theResourceProviderFactory, theCqlProviderFactory);
} }
@Bean @Bean

View File

@ -26,26 +26,27 @@ import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory; import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
/** /**
* This class loads and registers CQL provider factory for clinical reasoning into hapi-fhir central provider factory * This class loads and registers CQL provider factory for clinical reasoning into hapi-fhir central provider factory
**/ **/
@Service @Service
public class CrProviderLoader { public class CrProviderLoader {
private static final Logger myLogger = LoggerFactory.getLogger(CrProviderLoader.class); private static final Logger myLogger = LoggerFactory.getLogger(CrProviderLoader.class);
@Autowired private final FhirContext myFhirContext;
private FhirContext myFhirContext; private final ResourceProviderFactory myResourceProviderFactory;
@Autowired private final CrProviderFactory myCqlProviderFactory;
private ResourceProviderFactory myResourceProviderFactory;
@Autowired
private CrProviderFactory myCqlProviderFactory;
@PostConstruct public CrProviderLoader(FhirContext theFhirContext, ResourceProviderFactory theResourceProviderFactory, CrProviderFactory theCqlProviderFactory) {
public void loadProvider() { myFhirContext = theFhirContext;
myResourceProviderFactory = theResourceProviderFactory;
myCqlProviderFactory = theCqlProviderFactory;
loadProvider();
}
private void loadProvider() {
switch (myFhirContext.getVersion().getVersion()) { switch (myFhirContext.getVersion().getVersion()) {
case DSTU3: case DSTU3:
case R4: case R4:

View File

@ -19,7 +19,6 @@ class CrProviderLoaderDstu3Test extends BaseCrDstu3Test {
@Test @Test
public void testContextLoads() { public void testContextLoads() {
myCrProviderLoader.loadProvider();
myResourceProviderFactory.createProviders(); myResourceProviderFactory.createProviders();
ourLog.info("The CqlProviderLoader loaded and was able to create Providers."); ourLog.info("The CqlProviderLoader loaded and was able to create Providers.");
} }

View File

@ -22,7 +22,6 @@ public class CqlProviderLoaderR4Test extends BaseCrR4Test {
@Test @Test
public void contextLoads() { public void contextLoads() {
myCqlProviderLoader.loadProvider();
myResourceProviderFactory.createProviders(); myResourceProviderFactory.createProviders();
ourLog.info("The CqlProviderLoader loaded and was able to create Providers."); ourLog.info("The CqlProviderLoader loaded and was able to create Providers.");
} }

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -50,7 +50,7 @@ public class MdmSubmitterInterceptorLoader {
private SubscriptionSubmitInterceptorLoader mySubscriptionSubmitInterceptorLoader; private SubscriptionSubmitInterceptorLoader mySubscriptionSubmitInterceptorLoader;
@PostConstruct @PostConstruct
public void start() { public void loadInterceptors() {
if (!myMdmSettings.isEnabled()) { if (!myMdmSettings.isEnabled()) {
return; return;
} }

View File

@ -23,14 +23,14 @@ package ca.uhn.fhir.mdm.batch2;
import ca.uhn.fhir.batch2.coordinator.JobDefinitionRegistry; import ca.uhn.fhir.batch2.coordinator.JobDefinitionRegistry;
import ca.uhn.fhir.batch2.model.JobDefinition; import ca.uhn.fhir.batch2.model.JobDefinition;
import ca.uhn.fhir.mdm.batch2.clear.MdmClearAppCtx; import ca.uhn.fhir.mdm.batch2.clear.MdmClearAppCtx;
import ca.uhn.fhir.mdm.batch2.clear.MdmClearJobParameters;
import ca.uhn.fhir.mdm.batch2.submit.MdmSubmitAppCtx; import ca.uhn.fhir.mdm.batch2.submit.MdmSubmitAppCtx;
import org.springframework.beans.factory.annotation.Autowired; import ca.uhn.fhir.mdm.batch2.submit.MdmSubmitJobParameters;
import org.springframework.context.ApplicationContext; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import javax.annotation.PostConstruct;
import static ca.uhn.fhir.mdm.batch2.clear.MdmClearAppCtx.MDM_CLEAR_JOB_BEAN_NAME; import static ca.uhn.fhir.mdm.batch2.clear.MdmClearAppCtx.MDM_CLEAR_JOB_BEAN_NAME;
import static ca.uhn.fhir.mdm.batch2.submit.MdmSubmitAppCtx.MDM_SUBMIT_JOB_BEAN_NAME; import static ca.uhn.fhir.mdm.batch2.submit.MdmSubmitAppCtx.MDM_SUBMIT_JOB_BEAN_NAME;
@ -40,17 +40,10 @@ import static ca.uhn.fhir.mdm.batch2.submit.MdmSubmitAppCtx.MDM_SUBMIT_JOB_BEAN_
MdmSubmitAppCtx.class MdmSubmitAppCtx.class
}) })
public class MdmBatch2Config { public class MdmBatch2Config {
@Autowired @Bean
JobDefinitionRegistry myJobDefinitionRegistry; MdmJobDefinitionLoader mdmJobDefinitionLoader(JobDefinitionRegistry theJobDefinitionRegistry,
@Qualifier(MDM_CLEAR_JOB_BEAN_NAME) JobDefinition<MdmClearJobParameters> theClearJobDefinition,
@Autowired @Qualifier(MDM_SUBMIT_JOB_BEAN_NAME) JobDefinition<MdmSubmitJobParameters> theSubmitJobDefinition) {
ApplicationContext myApplicationContext; return new MdmJobDefinitionLoader(theJobDefinitionRegistry, theClearJobDefinition, theSubmitJobDefinition);
@PostConstruct
public void start() {
JobDefinition clearJobDefinition = myApplicationContext.getBean(MDM_CLEAR_JOB_BEAN_NAME, JobDefinition.class);
myJobDefinitionRegistry.addJobDefinitionIfNotRegistered(clearJobDefinition);
JobDefinition submitJobDefinition = myApplicationContext.getBean(MDM_SUBMIT_JOB_BEAN_NAME, JobDefinition.class);
myJobDefinitionRegistry.addJobDefinitionIfNotRegistered(submitJobDefinition);
} }
} }

View File

@ -0,0 +1,36 @@
package ca.uhn.fhir.mdm.batch2;
/*-
* #%L
* hapi-fhir-storage-mdm
* %%
* Copyright (C) 2014 - 2023 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import ca.uhn.fhir.batch2.coordinator.JobDefinitionRegistry;
import ca.uhn.fhir.batch2.model.JobDefinition;
import ca.uhn.fhir.mdm.batch2.clear.MdmClearJobParameters;
import ca.uhn.fhir.mdm.batch2.submit.MdmSubmitJobParameters;
public class MdmJobDefinitionLoader {
public MdmJobDefinitionLoader(JobDefinitionRegistry theJobDefinitionRegistry,
JobDefinition<MdmClearJobParameters> theClearJobDefinition,
JobDefinition<MdmSubmitJobParameters> theSubmitJobDefinition) {
theJobDefinitionRegistry.addJobDefinitionIfNotRegistered(theClearJobDefinition);
theJobDefinitionRegistry.addJobDefinitionIfNotRegistered(theSubmitJobDefinition);
}
}

View File

@ -33,7 +33,6 @@ import org.springframework.context.annotation.Configuration;
@Configuration @Configuration
public class MdmClearAppCtx { public class MdmClearAppCtx {
public static final String JOB_MDM_CLEAR = "MDM_CLEAR"; public static final String JOB_MDM_CLEAR = "MDM_CLEAR";
public static final String MDM_CLEAR_JOB_BEAN_NAME = "mdmClearJobDefinition"; public static final String MDM_CLEAR_JOB_BEAN_NAME = "mdmClearJobDefinition";
@ -83,4 +82,5 @@ public class MdmClearAppCtx {
public LoadGoldenIdsStep loadGoldenIdsStep(IGoldenResourceSearchSvc theGoldenResourceSearchSvc) { public LoadGoldenIdsStep loadGoldenIdsStep(IGoldenResourceSearchSvc theGoldenResourceSearchSvc) {
return new LoadGoldenIdsStep(theGoldenResourceSearchSvc); return new LoadGoldenIdsStep(theGoldenResourceSearchSvc);
} }
} }

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -40,7 +40,6 @@ import org.slf4j.LoggerFactory;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.annotation.PostConstruct;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
@ -67,10 +66,11 @@ public class FilesystemBinaryStorageSvcImpl extends BaseBinaryStorageSvcImpl {
myJsonSerializer = new ObjectMapper(); myJsonSerializer = new ObjectMapper();
myJsonSerializer.setSerializationInclusion(JsonInclude.Include.NON_NULL); myJsonSerializer.setSerializationInclusion(JsonInclude.Include.NON_NULL);
myJsonSerializer.enable(SerializationFeature.INDENT_OUTPUT); myJsonSerializer.enable(SerializationFeature.INDENT_OUTPUT);
createBasePathDirectory();
} }
@PostConstruct private void createBasePathDirectory() {
public void start() {
ourLog.info("Starting binary storage service with base path: {}", myBasePath); ourLog.info("Starting binary storage service with base path: {}", myBasePath);
mkdir(myBasePath); mkdir(myBasePath);

View File

@ -108,8 +108,20 @@ import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate; import org.springframework.transaction.support.TransactionTemplate;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.PostConstruct; import java.util.ArrayList;
import java.util.*; import java.util.Collection;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -129,7 +141,6 @@ public abstract class BaseTransactionProcessor {
public static final Pattern UNQUALIFIED_MATCH_URL_START = Pattern.compile("^[a-zA-Z0-9_]+="); public static final Pattern UNQUALIFIED_MATCH_URL_START = Pattern.compile("^[a-zA-Z0-9_]+=");
public static final Pattern INVALID_PLACEHOLDER_PATTERN = Pattern.compile("[a-zA-Z]+:.*"); public static final Pattern INVALID_PLACEHOLDER_PATTERN = Pattern.compile("[a-zA-Z]+:.*");
private static final Logger ourLog = LoggerFactory.getLogger(BaseTransactionProcessor.class); private static final Logger ourLog = LoggerFactory.getLogger(BaseTransactionProcessor.class);
private BaseStorageDao myDao;
@Autowired @Autowired
private PlatformTransactionManager myTxManager; private PlatformTransactionManager myTxManager;
@Autowired @Autowired
@ -173,11 +184,6 @@ public abstract class BaseTransactionProcessor {
myVersionAdapter = theVersionAdapter; myVersionAdapter = theVersionAdapter;
} }
@PostConstruct
public void start() {
ourLog.trace("Starting transaction processor");
}
private TaskExecutor getTaskExecutor() { private TaskExecutor getTaskExecutor() {
if (myExecutor == null) { if (myExecutor == null) {
myExecutor = myThreadPoolFactory.newThreadPool(myDaoConfig.getBundleBatchPoolSize(), myDaoConfig.getBundleBatchMaxPoolSize(), "bundle-batch-"); myExecutor = myThreadPoolFactory.newThreadPool(myDaoConfig.getBundleBatchPoolSize(), myDaoConfig.getBundleBatchMaxPoolSize(), "bundle-batch-");
@ -311,10 +317,6 @@ public abstract class BaseTransactionProcessor {
return theRes.getMeta().getLastUpdated(); return theRes.getMeta().getLastUpdated();
} }
public void setDao(BaseStorageDao theDao) {
myDao = theDao;
}
private IBaseBundle processTransactionAsSubRequest(RequestDetails theRequestDetails, IBaseBundle theRequest, String theActionName, boolean theNestedMode) { private IBaseBundle processTransactionAsSubRequest(RequestDetails theRequestDetails, IBaseBundle theRequest, String theActionName, boolean theNestedMode) {
BaseStorageDao.markRequestAsProcessingSubRequest(theRequestDetails); BaseStorageDao.markRequestAsProcessingSubRequest(theRequestDetails);
try { try {

View File

@ -56,7 +56,6 @@ import org.springframework.transaction.support.TransactionTemplate;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.annotation.PostConstruct;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
/** /**
@ -74,18 +73,13 @@ public class HapiTransactionService implements IHapiTransactionService {
protected PlatformTransactionManager myTransactionManager; protected PlatformTransactionManager myTransactionManager;
@Autowired @Autowired
protected IRequestPartitionHelperSvc myRequestPartitionHelperSvc; protected IRequestPartitionHelperSvc myRequestPartitionHelperSvc;
private boolean myCustomIsolationSupported; private volatile Boolean myCustomIsolationSupported;
@VisibleForTesting @VisibleForTesting
public void setInterceptorBroadcaster(IInterceptorBroadcaster theInterceptorBroadcaster) { public void setInterceptorBroadcaster(IInterceptorBroadcaster theInterceptorBroadcaster) {
myInterceptorBroadcaster = theInterceptorBroadcaster; myInterceptorBroadcaster = theInterceptorBroadcaster;
} }
@PostConstruct
public void start() {
myCustomIsolationSupported = isCustomIsolationSupported();
}
@Override @Override
public IExecutionBuilder withRequest(@Nullable RequestDetails theRequestDetails) { public IExecutionBuilder withRequest(@Nullable RequestDetails theRequestDetails) {
return new ExecutionBuilder(theRequestDetails); return new ExecutionBuilder(theRequestDetails);
@ -162,11 +156,15 @@ public class HapiTransactionService implements IHapiTransactionService {
} }
public boolean isCustomIsolationSupported() { public boolean isCustomIsolationSupported() {
if (myTransactionManager instanceof JpaTransactionManager) { if (myCustomIsolationSupported == null) {
JpaDialect jpaDialect = ((JpaTransactionManager) myTransactionManager).getJpaDialect(); if (myTransactionManager instanceof JpaTransactionManager) {
return (jpaDialect instanceof HibernateJpaDialect); JpaDialect jpaDialect = ((JpaTransactionManager) myTransactionManager).getJpaDialect();
myCustomIsolationSupported = (jpaDialect instanceof HibernateJpaDialect);
} else {
myCustomIsolationSupported = false;
}
} }
return false; return myCustomIsolationSupported;
} }
@VisibleForTesting @VisibleForTesting
@ -281,7 +279,7 @@ public class HapiTransactionService implements IHapiTransactionService {
txTemplate.setPropagationBehavior(theExecutionBuilder.myPropagation.value()); txTemplate.setPropagationBehavior(theExecutionBuilder.myPropagation.value());
} }
if (myCustomIsolationSupported && theExecutionBuilder.myIsolation != null && theExecutionBuilder.myIsolation != Isolation.DEFAULT) { if (isCustomIsolationSupported() && theExecutionBuilder.myIsolation != null && theExecutionBuilder.myIsolation != Isolation.DEFAULT) {
txTemplate.setIsolationLevel(theExecutionBuilder.myIsolation.value()); txTemplate.setIsolationLevel(theExecutionBuilder.myIsolation.value());
} }

View File

@ -20,6 +20,7 @@ package ca.uhn.fhir.jpa.searchparam.submit.interceptor;
* #L% * #L%
*/ */
import ca.uhn.fhir.IHapiBootOrder;
import ca.uhn.fhir.interceptor.api.IInterceptorService; import ca.uhn.fhir.interceptor.api.IInterceptorService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -37,7 +38,7 @@ public class SearchParamSubmitInterceptorLoader {
private IInterceptorService myInterceptorRegistry; private IInterceptorService myInterceptorRegistry;
@EventListener(classes = {ContextRefreshedEvent.class}) @EventListener(classes = {ContextRefreshedEvent.class})
@Order @Order(IHapiBootOrder.REGISTER_INTERCEPTORS)
public void start() { public void start() {
ourLog.info("Registering SearchParamValidatingInterceptor interceptor"); ourLog.info("Registering SearchParamValidatingInterceptor interceptor");
myInterceptorRegistry.registerInterceptor(mySearchParamValidatingInterceptor); myInterceptorRegistry.registerInterceptor(mySearchParamValidatingInterceptor);

View File

@ -25,15 +25,12 @@ import ca.uhn.fhir.jpa.api.model.TranslationQuery;
import ca.uhn.fhir.jpa.model.entity.TagTypeEnum; import ca.uhn.fhir.jpa.model.entity.TagTypeEnum;
import ca.uhn.fhir.sl.cache.Cache; import ca.uhn.fhir.sl.cache.Cache;
import ca.uhn.fhir.sl.cache.CacheFactory; import ca.uhn.fhir.sl.cache.CacheFactory;
import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.support.TransactionSynchronization; import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager; import org.springframework.transaction.support.TransactionSynchronizationManager;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.PostConstruct;
import java.util.Collection; import java.util.Collection;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.Map; import java.util.Map;
@ -52,16 +49,16 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
// TODO: JA2 extract an interface for this class and use it everywhere // TODO: JA2 extract an interface for this class and use it everywhere
public class MemoryCacheService { public class MemoryCacheService {
@Autowired private final DaoConfig myDaoConfig;
DaoConfig myDaoConfig; private final EnumMap<CacheEnum, Cache<?, ?>> myCaches = new EnumMap<>(CacheEnum.class);
private EnumMap<CacheEnum, Cache<?, ?>> myCaches; public MemoryCacheService(DaoConfig theDaoConfig) {
myDaoConfig = theDaoConfig;
@PostConstruct populateCaches();
public void start() { }
myCaches = new EnumMap<>(CacheEnum.class);
private void populateCaches() {
for (CacheEnum next : CacheEnum.values()) { for (CacheEnum next : CacheEnum.values()) {
long timeoutSeconds; long timeoutSeconds;
@ -94,7 +91,6 @@ public class MemoryCacheService {
myCaches.put(next, nextCache); myCaches.put(next, nextCache);
} }
} }
@ -188,11 +184,6 @@ public class MemoryCacheService {
return getCache(theCache).estimatedSize(); return getCache(theCache).estimatedSize();
} }
@VisibleForTesting
public void setDaoConfigForUnitTest(DaoConfig theDaoConfig) {
myDaoConfig = theDaoConfig;
}
public enum CacheEnum { public enum CacheEnum {
TAG_DEFINITION(TagDefinitionCacheKey.class), TAG_DEFINITION(TagDefinitionCacheKey.class),

View File

@ -20,9 +20,9 @@ package ca.uhn.fhir.jpa.validation;
* #L% * #L%
*/ */
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.support.IValidationSupport; import ca.uhn.fhir.context.support.IValidationSupport;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.jpa.api.dao.DaoRegistry; import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.RequestDetails;
@ -40,9 +40,7 @@ import org.hl7.fhir.r5.utils.validation.IResourceValidator;
import org.hl7.fhir.r5.utils.validation.IValidatorResourceFetcher; import org.hl7.fhir.r5.utils.validation.IValidatorResourceFetcher;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.PostConstruct;
import java.io.IOException; import java.io.IOException;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URISyntaxException; import java.net.URISyntaxException;
@ -52,16 +50,15 @@ public class ValidatorResourceFetcher implements IValidatorResourceFetcher {
private static final Logger ourLog = LoggerFactory.getLogger(ValidatorResourceFetcher.class); private static final Logger ourLog = LoggerFactory.getLogger(ValidatorResourceFetcher.class);
@Autowired private final FhirContext myFhirContext;
private DaoRegistry myDaoRegistry; private final IValidationSupport myValidationSupport;
@Autowired private final DaoRegistry myDaoRegistry;
private FhirContext myFhirContext; private final VersionSpecificWorkerContextWrapper myVersionSpecificContextWrapper;
@Autowired
private IValidationSupport myValidationSupport;
private VersionSpecificWorkerContextWrapper myVersionSpecificContextWrapper;
@PostConstruct public ValidatorResourceFetcher(FhirContext theFhirContext, IValidationSupport theValidationSupport, DaoRegistry theDaoRegistry) {
public void start() { myFhirContext = theFhirContext;
myValidationSupport = theValidationSupport;
myDaoRegistry = theDaoRegistry;
myVersionSpecificContextWrapper = VersionSpecificWorkerContextWrapper.newVersionSpecificWorkerContextWrapper(myValidationSupport); myVersionSpecificContextWrapper = VersionSpecificWorkerContextWrapper.newVersionSpecificWorkerContextWrapper(myValidationSupport);
} }

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId> <artifactId>hapi-deployable-pom</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> <relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent> </parent>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId> <artifactId>hapi-fhir</artifactId>
<version>6.3.11-SNAPSHOT</version> <version>6.3.12-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -2,12 +2,14 @@ package ca.uhn.fhir.to;
import ca.uhn.fhir.to.mvc.AnnotationMethodHandlerAdapterConfigurer; import ca.uhn.fhir.to.mvc.AnnotationMethodHandlerAdapterConfigurer;
import ca.uhn.fhir.to.util.WebUtil; import ca.uhn.fhir.to.util.WebUtil;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
import org.thymeleaf.spring5.SpringTemplateEngine; import org.thymeleaf.spring5.SpringTemplateEngine;
import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver; import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver;
import org.thymeleaf.spring5.view.ThymeleafViewResolver; import org.thymeleaf.spring5.view.ThymeleafViewResolver;
@ -49,8 +51,8 @@ public class FhirTesterMvcConfig extends WebMvcConfigurerAdapter {
} }
@Bean @Bean
public AnnotationMethodHandlerAdapterConfigurer annotationMethodHandlerAdapterConfigurer() { public AnnotationMethodHandlerAdapterConfigurer annotationMethodHandlerAdapterConfigurer(@Qualifier("requestMappingHandlerAdapter") RequestMappingHandlerAdapter theAdapter) {
return new AnnotationMethodHandlerAdapterConfigurer(); return new AnnotationMethodHandlerAdapterConfigurer(theAdapter);
} }
@Bean @Bean

Some files were not shown because too many files have changed in this diff Show More