-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround Fetch Binary breaks with latest JPA HAPI FHIR Server
- Loading branch information
1 parent
e77b133
commit d49fa7b
Showing
6 changed files
with
52 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
plugins/src/main/java/org/smartregister/fhir/gateway/plugins/RestTemplateUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.smartregister.fhir.gateway.plugins; | ||
|
||
import org.springframework.web.client.RestTemplate; | ||
|
||
public class RestTemplateUtil { | ||
private volatile RestTemplate restTemplate; | ||
|
||
public RestTemplate getRestTemplate() { | ||
RestTemplate localReferenceRestTemplate = restTemplate; | ||
if (localReferenceRestTemplate == null) { | ||
synchronized (this) { | ||
localReferenceRestTemplate = restTemplate; | ||
if (localReferenceRestTemplate == null) { | ||
restTemplate = localReferenceRestTemplate = new RestTemplate(); | ||
} | ||
} | ||
} | ||
return localReferenceRestTemplate; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters