diff --git a/dspace-api/src/main/java/org/dspace/scripts/DSpaceRunnable.java b/dspace-api/src/main/java/org/dspace/scripts/DSpaceRunnable.java index 2ea0a52d6e34..5f9693fee69b 100644 --- a/dspace-api/src/main/java/org/dspace/scripts/DSpaceRunnable.java +++ b/dspace-api/src/main/java/org/dspace/scripts/DSpaceRunnable.java @@ -64,6 +64,10 @@ private void setHandler(DSpaceRunnableHandler dSpaceRunnableHandler) { this.handler = dSpaceRunnableHandler; } + public DSpaceRunnableHandler getHandler() { + return this.handler; + } + /** * This method sets the appropriate DSpaceRunnableHandler depending on where it was ran from and it parses * the arguments given to the script diff --git a/dspace-server-webapp/pom.xml b/dspace-server-webapp/pom.xml index 0ba8f40d86ab..52a6cba34f50 100644 --- a/dspace-server-webapp/pom.xml +++ b/dspace-server-webapp/pom.xml @@ -367,6 +367,26 @@ + + + + addon-orchestrator + + + orchestrator.on + + + + + + it.4science.dspace + addon-orchestrator + ${addon-orchestrator.version} + jar + + + + diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/scripts/handler/impl/RestDSpaceRunnableHandler.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/scripts/handler/impl/RestDSpaceRunnableHandler.java index 1ad0765a0f8c..adc9d3c51c7c 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/scripts/handler/impl/RestDSpaceRunnableHandler.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/scripts/handler/impl/RestDSpaceRunnableHandler.java @@ -44,6 +44,8 @@ import org.dspace.scripts.factory.ScriptServiceFactory; import org.dspace.scripts.handler.DSpaceRunnableHandler; import org.dspace.scripts.service.ProcessService; +import org.dspace.services.ConfigurationService; +import org.dspace.services.factory.DSpaceServicesFactory; import org.dspace.utils.DSpace; import org.springframework.core.task.TaskExecutor; @@ -54,6 +56,7 @@ public class RestDSpaceRunnableHandler implements DSpaceRunnableHandler { private static final Logger log = org.apache.logging.log4j.LogManager .getLogger(RestDSpaceRunnableHandler.class); + private ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService(); private BitstreamService bitstreamService = ContentServiceFactory.getInstance().getBitstreamService(); private ProcessService processService = ScriptServiceFactory.getInstance().getProcessService(); private EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService(); @@ -298,8 +301,10 @@ public Process getProcess(Context context) { * @param script The script to be ran */ public void schedule(DSpaceRunnable script) { + String taskExecutorBeanName = configurationService.getProperty("dspace.task.executor", + "dspaceRunnableThreadExecutor"); TaskExecutor taskExecutor = new DSpace().getServiceManager() - .getServiceByName("dspaceRunnableThreadExecutor", TaskExecutor.class); + .getServiceByName(taskExecutorBeanName, TaskExecutor.class); Context context = new Context(); try { Process process = processService.find(context, processId); @@ -360,4 +365,17 @@ public List getSpecialGroups() { public Locale getLocale() { return this.locale; } + + public Integer getProcessId() { + return processId; + } + + public String getScriptName() { + return scriptName; + } + + public UUID getePersonId() { + return ePersonId; + } + } diff --git a/dspace/modules/additions/pom.xml b/dspace/modules/additions/pom.xml index 3077c65c456a..970e170d7a7c 100644 --- a/dspace/modules/additions/pom.xml +++ b/dspace/modules/additions/pom.xml @@ -283,6 +283,25 @@ + + + addon-orchestrator + + + orchestrator.on + + + + + + it.4science.dspace + addon-orchestrator + ${addon-orchestrator.version} + jar + + + + UTF-8 @@ -960,6 +961,24 @@ + + + addon-orchestrator + + false + + + + + it.4science.dspace + addon-orchestrator + ${addon-orchestrator.version} + jar + + + + +