Trying to fix handlers

This commit is contained in:
Luca Frosini 2022-06-07 18:11:13 +02:00
parent 07fe3ed96e
commit 7077f0ffb8
2 changed files with 7 additions and 6 deletions

View File

@ -105,9 +105,6 @@ public class EServiceHandler extends ApplicationLifecycleHandler {
Set<UUID> startContextsUUID = new HashSet<>();
ContextCache contextCache = ContextCache.getInstance();
for (String token : startTokens) {
String contextFullName = ContextUtility.getContextName(token);
UUID contextUUID = contextCache.getUUIDByFullName(contextFullName);
startContextsUUID.add(contextUUID);
try {
if (create) {
ContextUtility.setContextFromToken(token);
@ -124,6 +121,9 @@ public class EServiceHandler extends ApplicationLifecycleHandler {
logger.error("Unable to add {} with UUID {} to current context ({})", EService.NAME, uuid,
ContextUtility.getContextName(token), e);
}
String contextFullName = ContextUtility.getContextName(token);
UUID contextUUID = contextCache.getUUIDByFullName(contextFullName);
startContextsUUID.add(contextUUID);
}
Set<UUID> resourceContextsUUID = eServiceManager.getContextsUUID().keySet();

View File

@ -69,6 +69,7 @@ public class HostingNodeHandler extends ContainerHandler {
public HostingNodeHandler() {
super();
}
@Override
@ -105,9 +106,6 @@ public class HostingNodeHandler extends ContainerHandler {
Set<UUID> startContextsUUID = new HashSet<>();
ContextCache contextCache = ContextCache.getInstance();
for (String token : startTokens) {
String contextFullName = ContextUtility.getContextName(token);
UUID contextUUID = contextCache.getUUIDByFullName(contextFullName);
startContextsUUID.add(contextUUID);
try {
if (create) {
ContextUtility.setContextFromToken(token);
@ -126,6 +124,9 @@ public class HostingNodeHandler extends ContainerHandler {
logger.error("Unable to add {} with UUID {} to current context ({})", HostingNode.NAME, uuid,
ContextUtility.getContextName(token), e);
}
String contextFullName = ContextUtility.getContextName(token);
UUID contextUUID = contextCache.getUUIDByFullName(contextFullName);
startContextsUUID.add(contextUUID);
}
Set<UUID> resourceContextsUUID = hostingNodeManager.getContextsUUID().keySet();