Author: echatellier Date: 2009-10-12 14:25:49 +0200 (Mon, 12 Oct 2009) New Revision: 2778 Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/war/PollenWarLauncher.java Log: Init winstone launcher args with command line args Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/war/PollenWarLauncher.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/war/PollenWarLauncher.java 2009-10-11 12:15:03 UTC (rev 2777) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/war/PollenWarLauncher.java 2009-10-12 12:25:49 UTC (rev 2778) @@ -22,7 +22,6 @@ import java.io.IOException; import java.net.JarURLConnection; import java.net.URL; -import java.util.HashMap; import java.util.Map; import winstone.Launcher; @@ -53,7 +52,7 @@ System.out.println("Starting pollen embedded mode..."); - String fqnLauncherFile = PollenWarLauncher.class.getName().replaceAll("\\.", "/")+ ".class"; + String fqnLauncherFile = PollenWarLauncher.class.getName().replaceAll("\\.", "/") + ".class"; System.out.println("Search for launcher class : " + fqnLauncherFile); URL classFile = PollenWarLauncher.class.getClassLoader().getResource(fqnLauncherFile); @@ -63,14 +62,18 @@ File me = new File(((JarURLConnection) classFile.openConnection()).getJarFile().getName()); System.out.println(" - using warfile file : " + me); - Map hashArgs = new HashMap(); + // hashArgs map, initialized with command line args + Map<String, String> hashArgs = Launcher.getArgsFromCommandLine(args); + hashArgs.put("warfile", me.getAbsolutePath()); // or any other command line args, eg port // add jndi info to swap configuration file hashArgs.put("useJNDI", "true"); hashArgs.put("jndi.resource.configurationfilename", String.class.getName()); - hashArgs.put("jndi.param.configurationfilename.value", "pollenembedded.properties"); + hashArgs.put("jndi.param.configurationfilename.value","pollenembedded.properties"); + System.out.println(" - using args : " + hashArgs); + Launcher.initLogger(hashArgs); Launcher winstone = new Launcher(hashArgs); // spawns threads, so your application doesn't block }