git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/vre-management/smart-executor@113890 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
da1dc9ff3d
commit
99b9789039
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
/home/lucafrosini/workspace/runtime/tomcat/bin/shutdown.sh -force
|
||||
|
||||
mvn clean install -DskipTests=true
|
||||
|
||||
rm -rf $CATALINA_HOME/webapps/smart-executor*
|
||||
|
||||
cp ./target/smart-executor.war $CATALINA_HOME/webapps/
|
||||
|
||||
mkdir $CATALINA_HOME/webapps/smart-executor
|
||||
|
||||
unzip $CATALINA_HOME/webapps/smart-executor.war -d $CATALINA_HOME//webapps/smart-executor
|
||||
|
||||
cp /home/lucafrosini/.m2/repository/org/acme/HelloWorldPlugin/1.0.0-SNAPSHOT/HelloWorldPlugin-1.0.0-SNAPSHOT.jar $CATALINA_HOME/webapps/smart-executor/WEB-INF/lib/
|
||||
cp /home/lucafrosini/.m2/repository/org/gcube/dataanalysis/smart-generic-worker/1.0.0-SNAPSHOT/smart-generic-worker-1.0.0-SNAPSHOT-jar-with-dependencies.jar $CATALINA_HOME/webapps/smart-executor/WEB-INF/lib/
|
||||
|
||||
sleep 3s
|
||||
|
||||
/home/lucafrosini/workspace/runtime/tomcat/bin/startup.sh
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package org.gcube.vremanagement.executor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
|
||||
|
@ -13,7 +15,6 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
||||
*
|
||||
*/
|
||||
public class SmartContextServletListener implements ServletContextListener {
|
||||
|
||||
|
@ -35,7 +36,8 @@ public class SmartContextServletListener implements ServletContextListener {
|
|||
ApplicationContext ctx = ContextProvider.get();
|
||||
logger.debug(String.format("ApplicationContext %s", ctx));
|
||||
if(ctx!=null){
|
||||
SmartExecutorInitalizator.getScopes(ctx);
|
||||
List<String> scopes = SmartExecutorInitalizator.getScopes(ctx);
|
||||
logger.debug(String.format("Scopes %s", scopes));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -356,7 +356,9 @@ public class SmartExecutorInitalizator extends ApplicationLifecycleHandler {
|
|||
}
|
||||
|
||||
try {
|
||||
jdbcPersistenceConnector = new JDBCPersistenceConnector(ctx.persistence().location());
|
||||
if(jdbcPersistenceConnector == null){
|
||||
jdbcPersistenceConnector = new JDBCPersistenceConnector(ctx.persistence().location());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Unable to initialize PersistenceConnector. The Service will be aborted", e);
|
||||
return;
|
||||
|
|
|
@ -54,9 +54,14 @@ public class PluginManager {
|
|||
this.availablePlugins = new HashMap<String, PluginDeclaration>();
|
||||
ServiceLoader<PluginDeclaration> serviceLoader = ServiceLoader.load(PluginDeclaration.class);
|
||||
for (PluginDeclaration pluginDeclaration : serviceLoader) {
|
||||
logger.debug(String.format("%s plugin found", pluginDeclaration.getName()));
|
||||
String name = pluginDeclaration.getName();
|
||||
this.availablePlugins.put(name, pluginDeclaration);
|
||||
try {
|
||||
logger.debug(String.format("%s plugin found", pluginDeclaration.getName()));
|
||||
pluginDeclaration.init();
|
||||
String name = pluginDeclaration.getName();
|
||||
this.availablePlugins.put(name, pluginDeclaration);
|
||||
} catch (Exception e) {
|
||||
logger.debug(String.format("%s not initialized correctly. It will not be used", pluginDeclaration.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue