Skip to content

Commit

Permalink
[#9889] switch to signle threaded reflections scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasCir committed Oct 4, 2022
1 parent 768d626 commit 9cca21a
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import javax.interceptor.InvocationContext;

import org.reflections.Reflections;
import org.reflections.util.ConfigurationBuilder;

import de.symeda.sormas.backend.auditlog.AuditContextProducer;
import de.symeda.sormas.backend.auditlog.AuditLogServiceBean;
Expand All @@ -40,7 +41,13 @@ public class AuditLoggerInterceptor {
@EJB
AuditLoggerEjb.AuditLoggerEjbLocal auditLogger;

private static final Reflections reflections = new Reflections("de.symeda.sormas.backend", SubTypes);
private static final Reflections reflections;
static {

ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
configurationBuilder.forPackages("de.symeda.sormas.backend").addScanners(SubTypes).setParallel(false);
reflections = new Reflections(configurationBuilder);
}

private static final Set<Class<?>> adoServiceClasses = new HashSet<>(reflections.get(SubTypes.of(BaseAdoService.class).asClass()));

Expand Down Expand Up @@ -143,7 +150,6 @@ public Object logAudit(InvocationContext context) throws Exception {
return context.proceed();
}


// with this we ignore EJB calls which definitely originate from within the backend
// as they can never be called direct from outside (i.e., remote) of the backend
// expression yields true if it IS a local bean => should not be audited and ignored
Expand Down

0 comments on commit 9cca21a

Please sign in to comment.