move ILoggingService

This commit is contained in:
Grahame Grieve 2023-11-24 08:47:52 +11:00
parent 1814a69826
commit d1bec7bdba
5 changed files with 46 additions and 17 deletions

View File

@ -60,7 +60,7 @@ import org.hl7.fhir.exceptions.NoTerminologyServiceException;
import org.hl7.fhir.exceptions.TerminologyServiceException;
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
import org.hl7.fhir.r5.context.CanonicalResourceManager.CanonicalResourceProxy;
import org.hl7.fhir.r5.context.IWorkerContext.ILoggingService.LogCategory;
import org.hl7.fhir.r5.context.ILoggingService.LogCategory;
import org.hl7.fhir.r5.model.ActorDefinition;
import org.hl7.fhir.r5.model.BooleanType;
import org.hl7.fhir.r5.model.Bundle;
@ -3024,4 +3024,30 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
}
}
public void unload() {
codeSystems.unload();
valueSets.unload();
maps.unload();
transforms.unload();
structures.unload();
typeManager.unload();
measures.unload();
libraries.unload();
guides.unload();
capstmts.unload();
searchParameters.unload();
questionnaires.unload();
operations.unload();
plans.unload();
actors.unload();
requirements.unload();
systems.unload();
binaries.clear();
validationCache.clear();
txCache.clear();
}
}

View File

@ -0,0 +1,15 @@
package org.hl7.fhir.r5.context;
public interface ILoggingService {
public enum LogCategory {
INIT,
PROGRESS,
TX,
CONTEXT,
GENERATE,
HTML
}
public void logMessage(String message); // status messages, always display
public void logDebugMessage(ILoggingService.LogCategory category, String message); // verbose; only when debugging
public boolean isDebugLogging(); // whether to log debug information
}

View File

@ -499,19 +499,6 @@ public interface IWorkerContext {
public Map<String, NamingSystem> getNSUrlMap();
public TranslationServices translator();
public interface ILoggingService {
public enum LogCategory {
INIT,
PROGRESS,
TX,
CONTEXT,
GENERATE,
HTML
}
public void logMessage(String message); // status messages, always display
public void logDebugMessage(LogCategory category, String message); // verbose; only when debugging
public boolean isDebugLogging(); // whether to log debug information
}
public void setLogger(@Nonnull ILoggingService logger);
public ILoggingService getLogger();

View File

@ -53,7 +53,7 @@ import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.exceptions.FHIRFormatError;
import org.hl7.fhir.r5.context.CanonicalResourceManager.CanonicalResourceProxy;
import org.hl7.fhir.r5.context.IWorkerContext.ILoggingService.LogCategory;
import org.hl7.fhir.r5.context.ILoggingService.LogCategory;
import org.hl7.fhir.r5.formats.IParser;
import org.hl7.fhir.r5.formats.JsonParser;
import org.hl7.fhir.r5.formats.XmlParser;
@ -211,7 +211,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
private final boolean allowLoadingDuplicates;
@With
private final IWorkerContext.ILoggingService loggingService;
private final ILoggingService loggingService;
public SimpleWorkerContextBuilder() {
cacheTerminologyClientErrors = false;
@ -809,5 +809,6 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
}
}

View File

@ -3,7 +3,7 @@ package org.hl7.fhir.r5.context;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class SystemOutLoggingService implements IWorkerContext.ILoggingService {
public class SystemOutLoggingService implements ILoggingService {
private final boolean debug;