http://www.argeo.org/schema/slc-flow http://www.argeo.org/schema/slc-flow-0.12.xsd">\r
\r
<!-- Hello world -->\r
- <flow:flow name="hello/HelloWorld">\r
+ <flow:flow name="hello">\r
<description>Print Hello World!</description>\r
<bean p:message="Hello World!" class="org.argeo.slc.core.execution.tasks.Echo" />\r
</flow:flow>\r
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/eclipse/org.argeo.slc.client.ui/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/eclipse/org.argeo.slc.client.ui.source/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.support.jcr/0.13.1-SNAPSHOT" type="Directory"/>
+<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.support.jcr.source/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/commons/server/org.argeo.server.jcr/0.3.4-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/commons/server/org.argeo.server.jcr.source/0.3.4-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.server/0.13.1-SNAPSHOT" type="Directory"/>
+<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.server.source/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/commons/security/org.argeo.security.core/0.3.4-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/commons/security/org.argeo.security.core.source/0.3.4-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/springframework/org.springframework.web.servlet/2.5.6.SEC01" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/eclipse/org.argeo.slc.client.ui.dist/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/eclipse/org.argeo.slc.client.ui.dist.source/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.repo/0.13.1-SNAPSHOT" type="Directory"/>
+<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.repo.source/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.support.aether/0.13.1-SNAPSHOT" type="Directory"/>
+<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.support.aether.source/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/dep/osgi/org.argeo.dep.osgi.aether/1.11.0.0001" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/dep/osgi/org.argeo.dep.osgi.aether.source/1.11.0.0001" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/modules/org.argeo.slc.server.repo/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/dep/osgi/org.argeo.dep.osgi.bnd.source/0.0.384.0002" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/dep/org.argeo.slc.dep.backend/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.support.ant/0.13.1-SNAPSHOT" type="Directory"/>
+<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.support.ant.source/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/apache/ant/com.springsource.org.apache.tools.ant/1.7.1" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/apache/ant/com.springsource.org.apache.tools.ant.source/1.7.1" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/apache/ant/com.springsource.org.apache.tools.ant.launch/1.7.1" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/apache/bsf/com.springsource.org.apache.bsf/2.4.0" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/apache/bsf/com.springsource.org.apache.bsf.source/2.4.0" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.support.activemq/0.13.1-SNAPSHOT" type="Directory"/>
+<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.support.activemq.source/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/springframework/org.springframework.jms/2.5.6.SEC01" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/springframework/org.springframework.jms.source/2.5.6.SEC01" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/springframework/ws/org.springframework.oxm/1.5.9.A" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/javax/ejb/com.springsource.javax.ejb.source/3.0.0" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/javax/xml/rpc/com.springsource.javax.xml.rpc/1.1.0" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.support.equinox/0.13.1-SNAPSHOT" type="Directory"/>
+<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.support.equinox.source/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.support.osgi/0.13.1-SNAPSHOT" type="Directory"/>
+<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.support.osgi.source/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/objectweb/asm/com.springsource.org.objectweb.asm.attrs/2.2.3" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/objectweb/asm/com.springsource.org.objectweb.asm.attrs.source/2.2.3" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/objectweb/asm/com.springsource.org.objectweb.asm/2.2.3" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/commons/security/org.argeo.security.ui.admin/0.3.4-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/commons/security/org.argeo.security.ui.admin.source/0.3.4-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.unit/0.13.1-SNAPSHOT" type="Directory"/>
+<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.unit.source/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.core/0.13.1-SNAPSHOT" type="Directory"/>
+<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.core.source/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.specs/0.13.1-SNAPSHOT" type="Directory"/>
+<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.specs.source/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/aspectj/com.springsource.org.aspectj.runtime/1.6.3.RELEASE" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/aspectj/com.springsource.org.aspectj.runtime.source/1.6.3.RELEASE" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/aspectj/com.springsource.org.aspectj.weaver/1.6.3.RELEASE" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/apache/commons/com.springsource.org.apache.commons.codec/1.4.0" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/apache/commons/com.springsource.org.apache.commons.codec.source/1.4.0" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.support.simple/0.13.1-SNAPSHOT" type="Directory"/>
+<location path="${system_property:user.home}/.m2/repository/org/argeo/slc/runtime/org.argeo.slc.support.simple.source/0.13.1-SNAPSHOT" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/com/jcraft/jsch/com.springsource.com.jcraft.jsch/0.1.41" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/com/jcraft/jsch/com.springsource.com.jcraft.jsch.source/0.1.41" type="Directory"/>
<location path="${system_property:user.home}/.m2/repository/com/opensymphony/quartz/com.springsource.org.quartz/1.6.2" type="Directory"/>
<plugin id="org.argeo.slc.client.ui"/>
<plugin id="org.argeo.slc.client.ui.source"/>
<plugin id="org.argeo.slc.support.jcr"/>
+<plugin id="org.argeo.slc.support.jcr.source"/>
<plugin id="org.argeo.server.jcr"/>
<plugin id="org.argeo.server.jcr.source"/>
<plugin id="org.argeo.slc.server"/>
+<plugin id="org.argeo.slc.server.source"/>
<plugin id="org.argeo.security.core"/>
<plugin id="org.argeo.security.core.source"/>
<plugin id="org.springframework.web.servlet"/>
<plugin id="org.argeo.slc.client.ui.dist"/>
<plugin id="org.argeo.slc.client.ui.dist.source"/>
<plugin id="org.argeo.slc.repo"/>
+<plugin id="org.argeo.slc.repo.source"/>
<plugin id="org.argeo.slc.support.aether"/>
+<plugin id="org.argeo.slc.support.aether.source"/>
<plugin id="org.argeo.dep.osgi.aether"/>
<plugin id="org.argeo.dep.osgi.aether.source"/>
<plugin id="org.argeo.slc.server.repo"/>
<plugin id="biz.aQute.bnd.source"/>
<plugin id="org.argeo.slc.dep.backend"/>
<plugin id="org.argeo.slc.support.ant"/>
+<plugin id="org.argeo.slc.support.ant.source"/>
<plugin id="com.springsource.org.apache.tools.ant"/>
<plugin id="com.springsource.org.apache.tools.ant.source"/>
<plugin id="com.springsource.org.apache.tools.ant.launch"/>
<plugin id="com.springsource.org.apache.bsf"/>
<plugin id="com.springsource.org.apache.bsf.source"/>
<plugin id="org.argeo.slc.support.activemq"/>
+<plugin id="org.argeo.slc.support.activemq.source"/>
<plugin id="org.springframework.jms"/>
<plugin id="org.springframework.jms.source"/>
<plugin id="org.springframework.oxm"/>
<plugin id="com.springsource.javax.ejb.source"/>
<plugin id="com.springsource.javax.xml.rpc"/>
<plugin id="org.argeo.slc.support.equinox"/>
+<plugin id="org.argeo.slc.support.equinox.source"/>
<plugin id="org.argeo.slc.support.osgi"/>
+<plugin id="org.argeo.slc.support.osgi.source"/>
<plugin id="com.springsource.org.objectweb.asm.attrs"/>
<plugin id="com.springsource.org.objectweb.asm.attrs.source"/>
<plugin id="com.springsource.org.objectweb.asm"/>
<plugin id="org.argeo.security.ui.admin"/>
<plugin id="org.argeo.security.ui.admin.source"/>
<plugin id="org.argeo.slc.unit"/>
+<plugin id="org.argeo.slc.unit.source"/>
<plugin id="org.argeo.slc.core"/>
+<plugin id="org.argeo.slc.core.source"/>
<plugin id="org.argeo.slc.specs"/>
+<plugin id="org.argeo.slc.specs.source"/>
<plugin id="com.springsource.org.aspectj.runtime"/>
<plugin id="com.springsource.org.aspectj.runtime.source"/>
<plugin id="com.springsource.org.aspectj.weaver"/>
<plugin id="com.springsource.org.apache.commons.codec"/>
<plugin id="com.springsource.org.apache.commons.codec.source"/>
<plugin id="org.argeo.slc.support.simple"/>
+<plugin id="org.argeo.slc.support.simple.source"/>
<plugin id="com.springsource.com.jcraft.jsch"/>
<plugin id="com.springsource.com.jcraft.jsch.source"/>
<plugin id="com.springsource.org.quartz"/>
-log4j.rootLogger=WARN, file
-#log4j.rootLogger=WARN, console
+#log4j.rootLogger=WARN, file
+log4j.rootLogger=WARN, console
## Levels
log4j.logger.org.argeo=INFO
-configuration $CONF_DIR \
-data $DATA_DIR \
-Dslc.launch.module=$MODULE \
- -Dslc.launch.execution=$FLOW \
+ -Dslc.launch.flow=$FLOW \
+ -console \
-clean
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
\r
<!-- Manager -->\r
- <bean id="modulesManager" class="org.argeo.slc.osgi.OsgiExecutionModulesManager">\r
+ <bean id="modulesManager" class="org.argeo.slc.osgi.OsgiExecutionModulesManager"\r
+ init-method="init" destroy-method="destroy">\r
<property name="slcExecutionNotifiers" ref="slcExecutionListeners" />\r
<property name="bundlesManager" ref="bundlesManager" />\r
</bean>\r
import org.argeo.slc.execution.ExecutionSpecAttribute;
import org.springframework.aop.scope.ScopedObject;
import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.ApplicationContext;
efd.setPath("");
// Takes description from spring
- BeanDefinition bd = getBeanFactory().getBeanDefinition(name);
- efd.setDescription(bd.getDescription());
+ BeanFactory bf = getBeanFactory();
+ if (bf != null) {
+ BeanDefinition bd = getBeanFactory().getBeanDefinition(name);
+ efd.setDescription(bd.getDescription());
+ }
return efd;
}
}
}
+ /** @return can be null */
private ConfigurableListableBeanFactory getBeanFactory() {
+ if (applicationContext == null)
+ return null;
return ((ConfigurableApplicationContext) applicationContext)
.getBeanFactory();
}
import org.argeo.slc.deploy.ModuleDescriptor;
+/** Describes the information required to launch a flow */
public class ExecutionModuleDescriptor extends ModuleDescriptor {
private static final long serialVersionUID = -2394473464513029512L;
private List<ExecutionSpec> executionSpecs = new ArrayList<ExecutionSpec>();
/** Used to filter event notified to an execution notifier. */
public static String SLC_PROCESS_ID = "slc.process.id";
+ /** Unique launch module */
+ public static String UNIQUE_LAUNCH_MODULE_PROPERTY = "slc.launch.module";
+
+ /** Unique launch flow */
+ public static String UNIQUE_LAUNCH_FLOW_PROPERTY = "slc.launch.flow";
+
/** @return a full fledged module descriptor. */
public ExecutionModuleDescriptor getExecutionModuleDescriptor(
String moduleName, String version);
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!-- Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org> Licensed under \r
+ the Apache License, Version 2.0 (the "License"); you may not use this file \r
+ except in compliance with the License. You may obtain a copy of the License \r
+ at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable \r
+ law or agreed to in writing, software distributed under the License is distributed \r
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either \r
+ express or implied. See the License for the specific language governing permissions \r
+ and limitations under the License. -->\r
+\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"\r
+ xmlns:aop="http://www.springframework.org/schema/aop"\r
+ xsi:schemaLocation="\r
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
+ http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd\r
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">\r
+\r
+ <bean\r
+ class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">\r
+ <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />\r
+ <property name="ignoreUnresolvablePlaceholders" value="false" />\r
+ <property name="locations">\r
+ <value>osgibundle:equinox.properties\r
+ </value>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="commandProvider" class="org.argeo.slc.equinox.ExecutionCommandProvider">\r
+ <property name="modulesManager" ref="modulesManager" />\r
+ </bean>\r
+\r
+ <bean id="bundlesManager" class="org.argeo.slc.osgi.BundlesManager">\r
+ <property name="defaultTimeout" value="${slc.equinox.commandTimeout}" />\r
+ <property name="pollingPeriod" value="${slc.equinox.commandPollingPeriod}" />\r
+ </bean>\r
+\r
+ <bean id="modulesManager" class="org.argeo.slc.osgi.OsgiExecutionModulesManager">\r
+ <property name="bundlesManager" ref="bundlesManager" />\r
+ </bean>\r
+\r
+</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+\r
+ Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+-->\r
+\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
+ http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+ http://www.springframework.org/schema/beans \r
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+ <beans:import resource="classpath:org/argeo/slc/osgi/manager.xml" />\r
+\r
+ <service interface="org.eclipse.osgi.framework.console.CommandProvider"\r
+ ref="commandProvider" />\r
+\r
+ <!--\r
+ <service\r
+ interface="org.springframework.osgi.context.event.OsgiBundleApplicationContextListener"\r
+ ref="bundlesManager" />\r
+ -->\r
+</beans:beans>
\ No newline at end of file
--- /dev/null
+# Timeout for the SLC command in the OSGi console (in ms)
+slc.equinox.commandTimeout=10000
+# Polling period for synchronous OSGi commands (in ms)
+slc.equinox.commandPollingPeriod=100
\ No newline at end of file
import org.argeo.slc.SlcException;
import org.argeo.slc.osgi.OsgiExecutionModulesManager;
import org.argeo.slc.process.RealizedFlow;
-import org.eclipse.core.runtime.adaptor.EclipseStarter;
import org.eclipse.osgi.framework.console.CommandInterpreter;
import org.eclipse.osgi.framework.console.CommandProvider;
this.modulesManager = osgiModulesManager;
}
- public void init() throws Exception {
- final String module = System.getProperty("slc.launch.module");
- final String executionName = System.getProperty("slc.launch.execution");
- if (module != null) {
- new Thread() {
-
- @Override
- public void run() {
- try {
- launch(SLC_NO_REFRESH, module, executionName);
- // in case of failure OSGi runtime stays up and last
- // launch can be used to debug by calling 'slc'
- } catch (Exception e) {
- throw new SlcException("Error when executing "
- + executionName + " on " + module, e);
- }
- try {
- EclipseStarter.shutdown();
- } catch (Exception e) {
- throw new SlcException("Cannot shutdown equinox.", e);
- }
- }
-
- }.start();
- }
-
- }
}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"\r
- xmlns:aop="http://www.springframework.org/schema/aop"\r
- xsi:schemaLocation="\r
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
- http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd\r
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">\r
-\r
- <bean\r
- class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">\r
- <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />\r
- <property name="ignoreUnresolvablePlaceholders" value="false" />\r
- <property name="locations">\r
- <value>osgibundle:equinox.properties\r
- </value>\r
- </property>\r
- </bean>\r
-\r
- <bean id="commandProvider" class="org.argeo.slc.equinox.ExecutionCommandProvider"\r
- init-method="init">\r
- <property name="modulesManager" ref="modulesManager" />\r
- </bean>\r
-\r
- <bean id="bundlesManager" class="org.argeo.slc.osgi.BundlesManager">\r
- <property name="defaultTimeout" value="${slc.equinox.commandTimeout}" />\r
- <property name="pollingPeriod" value="${slc.equinox.commandPollingPeriod}" />\r
- </bean>\r
-\r
- <bean id="modulesManager" class="org.argeo.slc.osgi.OsgiExecutionModulesManager">\r
- <property name="bundlesManager" ref="bundlesManager" />\r
- </bean>\r
-\r
-</beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-\r
- Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
--->\r
-\r
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
- xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
- http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
- http://www.springframework.org/schema/beans \r
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
-\r
- <beans:import resource="classpath:org/argeo/slc/osgi/manager.xml" />\r
-\r
- <service interface="org.eclipse.osgi.framework.console.CommandProvider"\r
- ref="commandProvider" />\r
-\r
- <!--\r
- <service\r
- interface="org.springframework.osgi.context.event.OsgiBundleApplicationContextListener"\r
- ref="bundlesManager" />\r
- -->\r
-</beans:beans>
\ No newline at end of file
+++ /dev/null
-# Timeout for the SLC command in the OSGi console (in ms)
-slc.equinox.commandTimeout=10000
-# Polling period for synchronous OSGi commands (in ms)
-slc.equinox.commandPollingPeriod=100
\ No newline at end of file
}
@SuppressWarnings(value = { "unchecked" })
- public <T> T getSingleService(Class<T> clss, String filter) {
+ public <T> T getSingleService(Class<T> clss, String filter,
+ Boolean synchronous) {
Assert.isTrue(OsgiFilterUtils.isValidFilter(filter), "valid filter");
ServiceReference[] sfs;
try {
- sfs = bundleContext.getServiceReferences(clss.getName(), filter);
+ if (synchronous)
+ sfs = getServiceRefSynchronous(clss.getName(), filter);
+ else
+ sfs = bundleContext
+ .getServiceReferences(clss.getName(), filter);
} catch (InvalidSyntaxException e) {
throw new SlcException("Cannot retrieve service reference for "
+ filter, e);
}
public <T> T getSingleServiceStrict(Class<T> clss, String filter) {
- T service = getSingleService(clss, filter);
+ T service = getSingleService(clss, filter, true);
if (service == null)
throw new SlcException("No execution flow found for " + filter);
else
private Boolean registerFlowsToJmx = true;
+ public void init() throws Exception {
+ final String module = System.getProperty(UNIQUE_LAUNCH_MODULE_PROPERTY);
+ final String flow = System.getProperty(UNIQUE_LAUNCH_FLOW_PROPERTY);
+ if (module != null) {
+ // launch a flow and stops
+ new Thread("Unique Flow") {
+ @Override
+ public void run() {
+ try {
+ bundlesManager.startSynchronous(bundlesManager
+ .findRelatedBundle(bundlesManager
+ .findFromPattern(module)));
+ RealizedFlow lastLaunch = findRealizedFlow(module, flow);
+ if (lastLaunch == null)
+ throw new SlcException("Cannot find launch for "
+ + module + " " + flow);
+ execute(lastLaunch);
+ } catch (Exception e) {
+ throw new SlcException(
+ "Error when executing unique flow " + flow
+ + " on " + module, e);
+ } finally {
+ try {
+ bundlesManager.getBundleContext().getBundle(0)
+ .stop();
+ System.exit(0);
+ } catch (Exception e) {
+ log.error("Cannot shutdown equinox.", e);
+ System.exit(1);
+ }
+ }
+ }
+ }.start();
+ }
+
+ }
+
+ public void destroy() {
+
+ }
+
public synchronized ExecutionModuleDescriptor getExecutionModuleDescriptor(
String moduleName, String version) {
ExecutionModuleDescriptor md = new ExecutionModuleDescriptor();
protected ExecutionFlowDescriptorConverter findExecutionFlowDescriptorConverter(
String moduleName, String moduleVersion) {
-
String filter = "(&(Bundle-SymbolicName=" + moduleName
+ ")(Bundle-Version=" + moduleVersion + "))";
return bundlesManager.getSingleService(
- ExecutionFlowDescriptorConverter.class, filter);
+ ExecutionFlowDescriptorConverter.class, filter, false);
}
/**