X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.equinox%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fequinox%2FExecutionCommandProvider.java;fp=runtime%2Forg.argeo.slc.support.equinox%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fequinox%2FExecutionCommandProvider.java;h=ae064f65274a60fbf402a31a7c807215d3c2efb7;hb=bd4b487cc0b1841e7d42c84fa44f9e123a89b759;hp=3a90807807225921eee47c728f3d25446e61712a;hpb=7beaa7b00689e51eabe523402c7571c4f2507f77;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/equinox/ExecutionCommandProvider.java b/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/equinox/ExecutionCommandProvider.java index 3a9080780..ae064f652 100644 --- a/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/equinox/ExecutionCommandProvider.java +++ b/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/equinox/ExecutionCommandProvider.java @@ -4,6 +4,8 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.argeo.slc.SlcException; import org.argeo.slc.execution.ExecutionFlowDescriptor; import org.argeo.slc.execution.ExecutionModule; @@ -17,6 +19,9 @@ import org.springframework.osgi.context.BundleContextAware; public class ExecutionCommandProvider implements CommandProvider, BundleContextAware { + private final static Log log = LogFactory + .getLog(ExecutionCommandProvider.class); + private List executionModules; private BundleContext bundleContext; @@ -47,24 +52,24 @@ public class ExecutionCommandProvider implements CommandProvider, if (bundle != null) { moduleName = bundle.getSymbolicName(); -// try { -// bundle.stop(); -// bundle.update(); -// bundle.start(); -// -// // FIXME: potential infinite loop -// while (bundle.getState() == Bundle.STARTING) { -// try { -// Thread.sleep(500); -// } catch (InterruptedException e) { -// // silent -// } -// } -// } catch (BundleException e) { -// throw new SlcException( -// "Could not update the bundle for module " + moduleName, -// e); -// } + // try { + // bundle.stop(); + // bundle.update(); + // bundle.start(); + // + // // FIXME: potential infinite loop + // while (bundle.getState() == Bundle.STARTING) { + // try { + // Thread.sleep(500); + // } catch (InterruptedException e) { + // // silent + // } + // } + // } catch (BundleException e) { + // throw new SlcException( + // "Could not update the bundle for module " + moduleName, + // e); + // } } // Find module @@ -84,9 +89,12 @@ public class ExecutionCommandProvider implements CommandProvider, ExecutionFlowDescriptor descriptor = new ExecutionFlowDescriptor(); descriptor.setName(executionName); module.execute(descriptor); - return "Executed " + executionName + " from " + moduleName; + log.info("Executed " + executionName + " from " + moduleName); } else - return "Could not find any execution module matching these requirements."; + log + .warn("Could not find any execution module matching these requirements."); + + return null; } public String getHelp() {