Commit 5fd79f17 authored by Nicolas Dolet's avatar Nicolas Dolet

Add the intent debug as a dependency for the standalone distribution (required...

Add the intent debug as a dependency for the standalone distribution (required for the helloworld example)

Add target to svn:ignore for the maven-plugin and the doc module

Assembly-factory tools: FactoryCommandLine
  - remove classloader settings (useless since FraSCAti classloaders are updated)
  - access static methods in a static way
parent 37cf1d4b
......@@ -19,6 +19,8 @@
* Contact: frascati@ow2.org
*
* Author: Christophe Demarey
*
* Contributor(s): Nicolas Dolet
*/
package org.ow2.frascati.factory;
......@@ -44,7 +46,6 @@ import org.apache.commons.cli.PosixParser;
* @author Christophe Demarey.
*/
public class FactoryCommandLine {
private static final String FACTORY_VERSION = "0.4";
/** Definitions of option names */
private static final String HELP_OPT = "help";
private static final String PATH_OPT = "libpath";
......@@ -73,25 +74,26 @@ public class FactoryCommandLine {
// add options
options.addOption("h", HELP_OPT, false, "print this message.");
options.addOption(
OptionBuilder.withArgName( "lib.jar"+File.pathSeparator+"path/" )
.hasArgs()
.withValueSeparator(File.pathSeparatorChar)
.withDescription( "a separated list of jars/pathes used by the factory." )
.create(PATH_OPT) );
OptionBuilder.withArgName("lib.jar"+File.pathSeparator+"path/");
OptionBuilder.hasArgs();
OptionBuilder.withValueSeparator(File.pathSeparatorChar);
OptionBuilder.withDescription("a separated list of jars/pathes used by the factory.");
options.addOption(OptionBuilder.create(PATH_OPT));
options.addOption("s", SERVICE_NAME_OPT, true, "the name of the service to use."
+ " If not specified, the composite is run in a (standalone) server mode.");
options.addOption("m", METHOD_NAME_OPT, true,
"the name of the method to invoke. Can be only used if the -s option is specified.");
options.addOption("o", GF_OUTPUT_OPT, true, "the path of the base output directory.\n"
+ " Can only be used with the --use-generate-factory or --use-runtime-factory option.");
options.addOption(
OptionBuilder.withArgName( "path1"+File.pathSeparator+"path2" )
.hasArgs()
.withValueSeparator(File.pathSeparatorChar)
.withDescription( "a comma separated list of source folders used by the factory.\n"
+ " Can be only used with the --use-generate-factory option.")
.create(GF_SRC_ROOTS_OPT) );
OptionBuilder.withArgName( "path1"+File.pathSeparator+"path2");
OptionBuilder.hasArgs();
OptionBuilder.withValueSeparator(File.pathSeparatorChar);
OptionBuilder.withDescription( "a comma separated list of source folders used by the factory.\n"
+ " Can be only used with the --use-generate-factory option.");
options.addOption(OptionBuilder.create(GF_SRC_ROOTS_OPT));
factoryGroup.addOption( new Option("af", USE_ASSEMBLY_FACTORY_OPT, false, "Use the Assembly Factory.") );
factoryGroup.addOption( new Option("gf", USE_GENERATE_FACTORY_OPT, false, "Use the Generate Factory.") );
......@@ -248,7 +250,7 @@ public class FactoryCommandLine {
URLClassLoader urlcl = new URLClassLoader(urls, parent);
factory.setClassLoader(urlcl);
factory.run(compositeName, urls, cmd.getSrcRoots(), cmd.getBaseDir());
GenerateFactory.run(compositeName, urls, cmd.getSrcRoots(), cmd.getBaseDir());
} else {
AbstractFactory factory = null;
......@@ -267,23 +269,14 @@ public class FactoryCommandLine {
// TODO: manage classloader between Assembly Factory and Binding Factory
Thread.currentThread().setContextClassLoader(urlcl);
factory.run(factory, compositeName, cmd.getServiceName(), cmd.getMethodName(), urls);
Factory.run(factory, compositeName, cmd.getServiceName(), cmd.getMethodName(), urls);
} else {
Factory runtimeFactory = new Factory();
System.out.print("Running the Runtime Factory ");
System.out.println(" with "+compositeName+'/'+cmd.getServiceName()+'/'+cmd.getMethodName()+"\n");
// Add urls to current classloader
ClassLoader parent = runtimeFactory.getClassLoader();
URLClassLoader urlcl = new URLClassLoader(urls, parent);
runtimeFactory.setClassLoader(urlcl);
// needed when using binding factory
// TODO: manage classloader between Assembly Factory and Binding Factory
Thread.currentThread().setContextClassLoader(urlcl);
runtimeFactory.run(runtimeFactory, compositeName, cmd.getServiceName(), cmd.getMethodName(), urls, cmd.getBaseDir());
Factory.run(runtimeFactory, compositeName, cmd.getServiceName(), cmd.getMethodName(), urls, cmd.getBaseDir());
}
}
......
......@@ -70,7 +70,11 @@
<artifactId>frascati-explorer</artifactId>
<version>0.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati.intent</groupId>
<artifactId>frascati-debug</artifactId>
<version>0.1-SNAPSHOT</version>
</dependency>
<!-- other dependencies -->
<dependency>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment