Fixed serviceStateFacet management

This commit is contained in:
Luca Frosini 2020-11-24 21:08:24 +01:00
parent 591ccc645a
commit de30ff5988
1 changed files with 3 additions and 2 deletions

View File

@ -188,7 +188,7 @@ public class EServiceManager {
return eService;
}
public EService createEService() throws ResourceRegistryException {
ResourceRegistryClient resourceRegistryClient = ResourceRegistryClientFactory.create();
UUID eServiceUUID = UUID.fromString(applicationContext.id());
@ -208,7 +208,7 @@ public class EServiceManager {
} catch (NotFoundException e) {
eService = instantiateEService();
createActivatesRelation(eService);
serviceStateFacet = eService.getFacets(ServiceStateFacet.class).get(0);
} catch (AvailableInAnotherContextException e) {
addToContext();
try {
@ -256,6 +256,7 @@ public class EServiceManager {
try {
activates = resourceRegistryPublisher.createIsRelatedTo(activates);
this.eService = activates.getTarget();
} catch (NotFoundException e) {
logger.error("THIS IS REALLY STRANGE. YOU SHOULD NE BE HERE. Error while creating {}.", activates, e);
throw e;