log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{yyyyMMdd HH:mm:ss} %-5p %m [%t] %c%n
-# development appender (slow!)
+# development appender
log4j.appender.development=org.apache.log4j.ConsoleAppender
log4j.appender.development.layout=org.apache.log4j.PatternLayout
-log4j.appender.development.layout.ConversionPattern=%d{HH:mm:ss} [%16.16t] %5p %m (%F:%L) %c%n
+#log4j.appender.development.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%16.16t] %5p %m (%F:%L) %c%n
+log4j.appender.development.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p %m [%16.16t] %c%n
\r
<service interface="org.argeo.slc.execution.ExecutionModulesListener"\r
ref="executionModulesListener" />\r
- <service ref="agent" interface="org.argeo.slc.runtime.SlcAgent" />\r
+ <service ref="agent" interface="org.argeo.slc.execution.SlcAgent" />\r
\r
<service ref="fileSystemManager" interface="org.apache.commons.vfs.FileSystemManager" />\r
</beans:beans>
\ No newline at end of file
<list id="slcExecutionListeners" interface="org.argeo.slc.process.SlcExecutionNotifier"\r
cardinality="0..N" />\r
\r
- <list id="agents" interface="org.argeo.slc.runtime.SlcAgent"\r
+ <list id="agents" interface="org.argeo.slc.execution.SlcAgent"\r
cardinality="0..N">\r
<listener ref="vmAgentFactory" bind-method="register"\r
unbind-method="unregister" />\r
<!-- SERVICES -->\r
<service ref="modulesManager" interface="org.argeo.slc.execution.ExecutionModulesManager" />\r
\r
- <service ref="vmAgentFactory" interface="org.argeo.slc.runtime.SlcAgentFactory">\r
+ <service ref="vmAgentFactory" interface="org.argeo.slc.execution.SlcAgentFactory">\r
<service-properties>\r
<beans:entry key="argeo.slc.jcr.path" value="/slc:system/slc:agents/slc:vm" />\r
</service-properties>\r
<reference id="repository" interface="javax.jcr.Repository"\r
filter="(argeo.jcr.repository.alias=slc)" />\r
\r
- <list id="agentFactories" interface="org.argeo.slc.runtime.SlcAgentFactory">\r
+ <list id="agentFactories" interface="org.argeo.slc.execution.SlcAgentFactory">\r
<listener ref="processController" bind-method="register"\r
unbind-method="unregister" />\r
</list>\r
import org.apache.commons.logging.LogFactory;
import org.argeo.slc.SlcException;
import org.argeo.slc.execution.ExecutionProcess;
+import org.argeo.slc.execution.SlcAgent;
+import org.argeo.slc.execution.SlcAgentFactory;
import org.argeo.slc.jcr.SlcJcrConstants;
import org.argeo.slc.jcr.SlcJcrUtils;
import org.argeo.slc.jcr.SlcNames;
import org.argeo.slc.jcr.execution.JcrExecutionProcess;
-import org.argeo.slc.runtime.SlcAgent;
-import org.argeo.slc.runtime.SlcAgentFactory;
/**
* We use a separate class (not in UI components) so that it can be a singleton
import org.argeo.slc.execution.ExecutionProcess;
import org.argeo.slc.execution.ExecutionProcessNotifier;
import org.argeo.slc.execution.ExecutionStep;
+import org.argeo.slc.execution.SlcAgent;
+import org.argeo.slc.execution.SlcAgentDescriptor;
import org.argeo.slc.process.SlcExecution;
-import org.argeo.slc.runtime.SlcAgent;
-import org.argeo.slc.runtime.SlcAgentDescriptor;
/** Implements the base methods of an SLC agent. */
@SuppressWarnings("deprecation")
+ agentDescriptor.getUuid());
modulesManager.registerProcessNotifier(this,
new HashMap<String, String>());
+
+ // final String module = System
+ // .getProperty(ExecutionModulesManager.UNIQUE_LAUNCH_MODULE_PROPERTY);
+ // final String flow = System
+ // .getProperty(ExecutionModulesManager.UNIQUE_LAUNCH_FLOW_PROPERTY);
+ // if (module != null) {
+ // // launch a flow and stops
+ // new Thread("Unique Flow") {
+ // @Override
+ // public void run() {
+ // executeFlowAndExit(module, null, flow);
+ // }
+ // }.start();
+ // }
}
/** Clean up (needs to be called by overriding method) */
return UUID.randomUUID().toString();
}
+ /*
+ * UNIQUE FLOW
+ */
+ // protected void executeFlowAndExit(final String module,
+ // final String version, final String flow) {
+ // }
+
/*
* SLC AGENT
*/
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.runtime.SlcAgent;
-import org.argeo.slc.runtime.SlcAgentFactory;
+import org.argeo.slc.execution.SlcAgent;
+import org.argeo.slc.execution.SlcAgentFactory;
/** Register agents (typically via OSGi listeners) */
public class DefaultAgentFactory implements SlcAgentFactory {
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.slc.core.runtime;
-
-import java.util.List;
-
-import org.argeo.slc.runtime.SlcAgent;
-import org.argeo.slc.runtime.SlcAgentFactory;
-
-/** @deprecated old prototype, should be removed */
-public class SimpleAgentFactory implements SlcAgentFactory {
- private List<SlcAgent> agents;
-
- public SlcAgent getAgent(String uuid) {
- for (SlcAgent agent : agents)
- if (agent.getAgentUuid().equals(uuid))
- return agent;
- return null;
- }
-
- public void pingAll(List<String> activeAgentIds) {
- // do nothing
- }
-
- public void setAgents(List<SlcAgent> agents) {
- this.agents = agents;
- }
-
-}
log4j.logger.org.springframework.web.servlet.PageNotFound=ERROR
log4j.logger.org.argeo.server.webextender.TomcatDeployer=WARN
+#log4j.logger.org.apache=DEBUG
+#log4j.logger.org.springframework.security=DEBUG
+
log4j.logger.org.apache.coyote=INFO
log4j.logger.org.apache.catalina.core.ContainerBase=INFO
log4j.logger.org.apache.directory.server=ERROR
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{yyyyMMdd HH:mm:ss} %-5p %m [%t] %c%n
-# development appender (slow!)
+# development appender
log4j.appender.development=org.apache.log4j.ConsoleAppender
log4j.appender.development.layout=org.apache.log4j.PatternLayout
-log4j.appender.development.layout.ConversionPattern=%d{HH:mm:ss} [%16.16t] %5p %m (%F:%L) %c%n
+#log4j.appender.development.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%16.16t] %5p %m (%F:%L) %c%n
+log4j.appender.development.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p %m [%16.16t] %c%n
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.argeo.slc</groupId>
<artifactId>org.argeo.slc.support.osgi</artifactId>
<version>1.1.12-SNAPSHOT</version>
</dependency>
-
- <!-- SLC Agent Modules -->
<dependency>
<groupId>org.argeo.slc</groupId>
<artifactId>org.argeo.slc.agent</artifactId>
<version>${version.argeo-commons}</version>
</dependency>
- <!-- Logging -->
- <dependency>
- <groupId>org.argeo.commons.base</groupId>
- <artifactId>org.argeo.dep.log4j</artifactId>
- <version>${version.argeo-commons}</version>
- <type>pom</type>
- </dependency>
-
<!-- Spring OSGi -->
<dependency>
<groupId>org.argeo.tp</groupId>
<groupId>org.argeo.tp</groupId>
<artifactId>org.apache.commons.cli</artifactId>
</dependency>
+
+ <!-- Logging -->
+ <dependency>
+ <groupId>org.argeo.commons.base</groupId>
+ <artifactId>org.argeo.dep.log4j</artifactId>
+ <version>${version.argeo-commons}</version>
+ <type>pom</type>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
+import java.util.UUID;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
// private static String bundlesToInstall = "/usr/share/osgi;in=*.jar";
private String bundlesToInstall = System.getProperty("user.home")
- + "/dev/src/slc/runtime/org.argeo.slc.launcher/target/dependency;in=*.jar,"
+ + "/dev/src/slc/dep/org.argeo.slc.dep.minimal/target/dependency;in=*.jar,"
+ System.getProperty("user.home")
+ "/dev/src/slc/demo/modules;in=*;ex=pom.xml;ex=.svn";
- // private static String bundlesToStart =
- // "org.springframework.osgi.extender,"
- // + "org.argeo.node.repofactory.jackrabbit,"
- // + "org.argeo.node.repo.jackrabbit," + "org.argeo.security.dao.os,"
- // + "org.argeo.slc.node.jackrabbit," + "org.argeo.slc.agent,"
- // + "org.argeo.slc.agent.jcr";
private final List<String> bundlesToStart = new ArrayList<String>();
public SlcMain(String[] args) {
this.args = args;
+ // bundlesToStart.add("org.springframework.osgi.extender");
+ // bundlesToStart.add("org.argeo.slc.agent");
+
bundlesToStart.add("org.springframework.osgi.extender");
+ bundlesToStart.add("org.argeo.node.repo.jackrabbit");
+ bundlesToStart.add("org.argeo.security.dao.os");
+ bundlesToStart.add("org.argeo.slc.node.jackrabbit");
bundlesToStart.add("org.argeo.slc.agent");
+ bundlesToStart.add("org.argeo.slc.agent.jcr");
}
@SuppressWarnings("unchecked")
String executionDir = System.getProperty("user.dir");
File slcDir = new File(executionDir, "target/.slc");
- File dataDir = new File(slcDir, "data");
+ File tempDir = new File(System.getProperty("java.io.tmpdir"));
+
+ File dataDir = new File(tempDir, "slc-data-"
+ + UUID.randomUUID().toString());
if (!dataDir.exists())
dataDir.mkdirs();
+
File confDir = new File(slcDir, "conf");
if (!confDir.exists())
confDir.mkdirs();
System.setProperty(UNIQUE_LAUNCH_MODULE_PROPERTY, module);
System.setProperty(UNIQUE_LAUNCH_FLOW_PROPERTY, flow);
System.setProperty("log4j.configuration", "file:./log4j.properties");
-
+ System.setProperty("argeo.node.repo.configuration",
+ "osgibundle:repository-memory.xml");
// start runtime
osgiBoot.startBundles(bundlesToStart);
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.slc.execution;
+
+import java.util.List;
+
+
+/** A local agent, able to run SLC Execution locally. */
+public interface SlcAgent {
+ /** Agent unique identifier */
+ public String getAgentUuid();
+
+ /** Execute / take part to this process */
+ public void process(ExecutionProcess process);
+
+ /** Kills this process */
+ public void kill(ExecutionProcess process);
+
+ public ExecutionModuleDescriptor getExecutionModuleDescriptor(
+ String moduleName, String version);
+
+ public List<ExecutionModuleDescriptor> listExecutionModuleDescriptors();
+
+ /** @return true if still alive. */
+ public boolean ping();
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.slc.execution;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class SlcAgentDescriptor implements Cloneable, Serializable {
+ private static final long serialVersionUID = 1L;
+ private String uuid;
+ private String host;
+ private List<ExecutionModuleDescriptor> moduleDescriptors = new ArrayList<ExecutionModuleDescriptor>();
+
+ public SlcAgentDescriptor() {
+
+ }
+
+ public SlcAgentDescriptor(SlcAgentDescriptor template) {
+ uuid = template.uuid;
+ host = template.host;
+ moduleDescriptors.addAll(template.moduleDescriptors);
+ }
+
+ public String getUuid() {
+ return uuid;
+ }
+
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ public void setHost(String host) {
+ this.host = host;
+ }
+
+ public List<ExecutionModuleDescriptor> getModuleDescriptors() {
+ return moduleDescriptors;
+ }
+
+ public void setModuleDescriptors(
+ List<ExecutionModuleDescriptor> modulesDescriptors) {
+ this.moduleDescriptors = modulesDescriptors;
+ }
+
+ @Override
+ public String toString() {
+ return host + " #" + uuid;
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.slc.execution;
+
+import java.util.List;
+
+public interface SlcAgentFactory {
+ public SlcAgent getAgent(String uuid);
+
+ public void pingAll(List<String> activeAgentIds);
+}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.slc.runtime;
-
-import java.util.List;
-
-import org.argeo.slc.execution.ExecutionModuleDescriptor;
-import org.argeo.slc.execution.ExecutionProcess;
-
-/** A local agent, able to run SLC Execution locally. */
-public interface SlcAgent {
- /** Agent unique identifier */
- public String getAgentUuid();
-
- /** Execute / take part to this process */
- public void process(ExecutionProcess process);
-
- /** Kills this process */
- public void kill(ExecutionProcess process);
-
- public ExecutionModuleDescriptor getExecutionModuleDescriptor(
- String moduleName, String version);
-
- public List<ExecutionModuleDescriptor> listExecutionModuleDescriptors();
-
- /** @return true if still alive. */
- public boolean ping();
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.slc.runtime;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.argeo.slc.execution.ExecutionModuleDescriptor;
-
-public class SlcAgentDescriptor implements Cloneable, Serializable {
- private static final long serialVersionUID = 1L;
- private String uuid;
- private String host;
- private List<ExecutionModuleDescriptor> moduleDescriptors = new ArrayList<ExecutionModuleDescriptor>();
-
- public SlcAgentDescriptor() {
-
- }
-
- public SlcAgentDescriptor(SlcAgentDescriptor template) {
- uuid = template.uuid;
- host = template.host;
- moduleDescriptors.addAll(template.moduleDescriptors);
- }
-
- public String getUuid() {
- return uuid;
- }
-
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- public String getHost() {
- return host;
- }
-
- public void setHost(String host) {
- this.host = host;
- }
-
- public List<ExecutionModuleDescriptor> getModuleDescriptors() {
- return moduleDescriptors;
- }
-
- public void setModuleDescriptors(
- List<ExecutionModuleDescriptor> modulesDescriptors) {
- this.moduleDescriptors = modulesDescriptors;
- }
-
- @Override
- public String toString() {
- return host + " #" + uuid;
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.slc.runtime;
-
-import java.util.List;
-
-public interface SlcAgentFactory {
- public SlcAgent getAgent(String uuid);
-
- public void pingAll(List<String> activeAgentIds);
-}