Setting first token because observer is invoked without setting the current context

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/Common/resource-registry-handlers@148244 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2017-05-02 15:28:47 +00:00
parent ac9d29e413
commit 21b7ee7ee8
1 changed files with 5 additions and 1 deletions

View File

@ -579,7 +579,11 @@ public class EServiceManager extends ApplicationLifecycleHandler {
@SuppressWarnings("unchecked")
private void createOrUpdateServiceStateFacet(EService eService, String state) throws ResourceRegistryException {
String previousToken = SecurityTokenProvider.instance.get();
if (previousToken == null) {
setContextFromToken((String) applicationContext.configuration().startTokens().toArray()[0]);
}
ClassLoader contextCL = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(EServiceManager.class.getClassLoader());