Do not stop the service if publishing o new IS fails

This commit is contained in:
Luca Frosini 2020-10-14 14:57:33 +02:00
parent fd30b3dd0d
commit cf094b088e
3 changed files with 7 additions and 4 deletions

View File

@ -8,6 +8,7 @@ import org.gcube.smartgears.ContextProvider;
import org.gcube.smartgears.context.application.ApplicationContext; import org.gcube.smartgears.context.application.ApplicationContext;
import org.gcube.vremanagement.executor.api.types.LaunchParameter; import org.gcube.vremanagement.executor.api.types.LaunchParameter;
import org.gcube.vremanagement.executor.ispublisher.ISPublisher; import org.gcube.vremanagement.executor.ispublisher.ISPublisher;
import org.gcube.vremanagement.executor.ispublisher.RestISPublisher;
import org.gcube.vremanagement.executor.json.ExtendedSEMapper; import org.gcube.vremanagement.executor.json.ExtendedSEMapper;
import org.gcube.vremanagement.executor.persistence.SmartExecutorPersistenceConnector; import org.gcube.vremanagement.executor.persistence.SmartExecutorPersistenceConnector;
import org.gcube.vremanagement.executor.persistence.SmartExecutorPersistenceFactory; import org.gcube.vremanagement.executor.persistence.SmartExecutorPersistenceFactory;
@ -66,8 +67,10 @@ public class SmartExecutorInitializator implements ApplicationManager {
try { try {
isPublisher.publishPlugins(availablePlugins); isPublisher.publishPlugins(availablePlugins);
}catch (Exception e) { }catch (Exception e) {
logger.error("Unable to Create ServiceEndpoint for scope {}. The Service will be aborted", scope, e); logger.error("Unable to create plugins is resources in context {}. The Service will be aborted", scope, e);
throw new RuntimeException(e); if(!(isPublisher instanceof RestISPublisher)) {
throw new RuntimeException(e);
}
} }
} }

View File

@ -31,7 +31,7 @@ import org.gcube.vremanagement.executor.pluginmanager.PluginManager;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
class GCoreISPublisher extends ISPublisher { public class GCoreISPublisher extends ISPublisher {
private static Logger logger = LoggerFactory.getLogger(GCoreISPublisher.class); private static Logger logger = LoggerFactory.getLogger(GCoreISPublisher.class);

View File

@ -37,7 +37,7 @@ import org.gcube.vremanagement.executor.pluginmanager.PluginManager;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
class RestISPublisher extends ISPublisher { public class RestISPublisher extends ISPublisher {
private static Logger logger = LoggerFactory.getLogger(RestISPublisher.class); private static Logger logger = LoggerFactory.getLogger(RestISPublisher.class);