<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="output" path="target/classes"/>
</classpath>
<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>argeo-slc</artifactId>
- <version>0.11.1-SNAPSHOT</version>
- <relativePath>../org.argeo.slc</relativePath>
- </parent>
- <artifactId>org.argeo.slc.detached.launcher</artifactId>
- <name>Argeo SLC Detached Launcher</name>
- <packaging>jar</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.3</source>
- <target>1.3</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.detached</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.main</artifactId>
- </dependency>
- <!-- Spring -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>2.0.8</version>
- </dependency>
+ 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>argeo-slc</artifactId>
+ <version>0.11.1-SNAPSHOT</version>
+ <relativePath>../org.argeo.slc</relativePath>
+ </parent>
+ <artifactId>org.argeo.slc.detached.launcher</artifactId>
+ <name>Argeo SLC Detached Launcher</name>
+ <packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.3</source>
+ <target>1.3</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>
+ org.argeo.slc.detached.launcher.Main
+ </mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/dist.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>attach-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.main</artifactId>
+ </dependency>
+ <!-- Spring -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>2.0.8</version>
+ </dependency>
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </dependency>
- </dependencies>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
--- /dev/null
+<assembly 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/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+ <id>dist</id>
+ <formats>
+ <format>tar.gz</format>
+ </formats>
+ <dependencySets>
+ <dependencySet>
+ <unpack>false</unpack>
+ <outputDirectory>lib</outputDirectory>
+ <includes>
+ <include>*:jar</include>
+ </includes>
+ </dependencySet>
+ <!--
+ <dependencySet>
+ <unpack>true</unpack>
+ <outputDirectory></outputDirectory>
+ <outputFileNameMapping></outputFileNameMapping>
+ <includes>
+ <include>
+ org.argeo.slc:argeo-slc-agent:tar.gz:base
+ </include>
+ </includes>
+ <fileMode>0755</fileMode>
+ </dependencySet>
+ -->
+ </dependencySets>
+</assembly>
\ No newline at end of file
package org.argeo.slc.detached.launcher;
import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
private final static Log log = LogFactory.getLog(Main.class);
public static void main(String[] args) {
+ log.info("Argeo SLC Detached launcher starting...");
try {
// Load properties
- Properties config = prepareConfig();
+ String propertyPath = "slc-detached.properties";
+ Properties config = prepareConfig(propertyPath);
+
+ // Create cache dir
+ if (!config.containsKey(BundleCache.CACHE_PROFILE_DIR_PROP)) {
+ final File cachedir = createTemporaryCacheDir();
+ config.put(BundleCache.CACHE_PROFILE_DIR_PROP, cachedir
+ .getAbsolutePath());
+ }
- // Start UI (in main class loader)
- startUi(config);
+ // Start app (in main class loader)
+ startApp(config);
// Thread.sleep(10000);
// Start OSGi system
}
}
- protected static Properties prepareConfig() throws Exception {
- final File cachedir = createTemporaryCacheDir();
-
+ protected static Properties prepareConfig(String propertyFilePath)
+ throws Exception {
// Load config
Properties config = new Properties();
InputStream in = null;
in.close();
}
+ try {
+ in = new FileInputStream(propertyFilePath);
+ config.load(in);
+ } finally {
+ if (in != null)
+ in.close();
+ }
+
+ // System properties have priority.
+ config.putAll(System.getProperties());
+
// Perform variable substitution for system properties.
for (Enumeration e = config.propertyNames(); e.hasMoreElements();) {
String name = (String) e.nextElement();
config.setProperty(name, org.apache.felix.main.Main.substVars(
config.getProperty(name), name, null, config));
+ if (log.isTraceEnabled())
+ log.trace(name + "=" + config.getProperty(name));
}
- config.put(BundleCache.CACHE_PROFILE_DIR_PROP, cachedir
- .getAbsolutePath());
-
- // System properties have priority.
- config.putAll(System.getProperties());
-
return config;
}
return felix;
}
- public static void startUi(Properties config) throws Exception {
- String className = config.getProperty("argeo.scl.autoui.uiclass");
+ public static void startApp(Properties config) throws Exception {
+ String className = config.getProperty("argeo.scl.detached.appclass");
String[] uiArgs = readArgumentsFromLine(config.getProperty(
- "argeo.slc.autoui.uiargs", ""));
+ "argeo.slc.detached.appargs", ""));
// Launch main method using reflection
Class clss = Class.forName(className);
--- /dev/null
+# Set root logger level to DEBUG and its only appender to A1.\r
+log4j.rootLogger=WARN, console\r
+\r
+## Levels\r
+# Slc\r
+log4j.logger.org.argeo.slc=DEBUG\r
+\r
+## Appenders\r
+# A1 is set to be a ConsoleAppender.\r
+log4j.appender.console=org.apache.log4j.ConsoleAppender\r
+\r
+# A1 uses PatternLayout.\r
+log4j.appender.console.layout=org.apache.log4j.PatternLayout\r
+log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c %n\r
+\r
# Argeo Specific Context Properties
-argeo.slc.mavenBase=file:${user.home}/.m2/repository/
+argeo.slc.mavenBase=file:${user.home}/.m2/repository
-argeo.scl.autoui.uiclass=org.argeo.slc.testui.SwingTestUi
-argeo.slc.autoui.uiargs=noExitOnClose
+argeo.scl.detached.appclass=org.argeo.slc.testui.SwingTestUi
+argeo.slc.detached.appargs=noExitOnClose
#
# Framework config properties.
# file:bundle/org.apache.felix.shell.tui-1.0.2.jar \
# file:bundle/org.apache.felix.bundlerepository-1.2.0.jar
-felix.auto.start.1= \
- reference:file:${user.dir}/../sandbox/argeo.slc.jemmytest/bin/ \
- reference:file:${user.dir}/../org.argeo.slc.detached/bin/ \
- ${argeo.slc.mavenBase}org/apache/felix/org.apache.felix.shell/1.0.2/org.apache.felix.shell-1.0.2.jar \
- ${argeo.slc.mavenBase}org/apache/felix/org.apache.felix.shell.tui/1.0.2/org.apache.felix.shell.tui-1.0.2.jar \
- ${argeo.slc.mavenBase}org/argeo/dep/jemmy/org.argeo.dep.jemmy.nb61/0.2.2/org.argeo.dep.jemmy.nb61-0.2.2.jar
+#felix.auto.start.1= \
+# reference:file:${user.dir}/../sandbox/argeo.slc.jemmytest/bin/ \
+# reference:file:${user.dir}/../org.argeo.slc.detached/bin/ \
+# ${argeo.slc.mavenBase}/org/apache/felix/org.apache.felix.shell/1.0.2/org.apache.felix.shell-1.0.2.jar \
+# ${argeo.slc.mavenBase}/org/apache/felix/org.apache.felix.shell.tui/1.0.2/org.apache.felix.shell.tui-1.0.2.jar \
+# ${argeo.slc.mavenBase}/org/argeo/dep/jemmy/org.argeo.dep.jemmy.nb61/0.2.2/org.argeo.dep.jemmy.nb61-0.2.2.jar
# ${argeo.slc.mavenBase}org/argeo/slc/sandbox/org.argeo.slc.sandbox.jemmytest/0.1.2-SNAPSHOT/org.argeo.slc.sandbox.jemmytest-0.1.2-SNAPSHOT.jar"