Sheldon Wosnick wrote:
I am have been experimenting with the DomainManger and the DomainManager Launcher in Tuscany1.2.1 and have three questions if anyone knows the answers:

1. It seems composites files (.composite) must be located in the binaries location of a directory structure to find them.

Application developers need to package their composites in SCA contributions (JARs or folders) with their other application artifacts. If your contribution needs to contain your Java classes and you're using Eclipse it's usually your Eclipse project's binary/output location, but Tuscany does not make any assumption about that.

The 'deployment' composite provided to createSCANode(uri, contributions) is usually in one of the contributions, but can also be outside of the contributions. That's particularly useful if that 'deployment' composite is generated or edited independent of the contributions provided by the application developer and contains deployment specific info.

More below on that scheme.


Although in configuring the node I am passing a composite URI (composite name), contribution URI (root of the contribution structure) and contribution location URI (location of the binaries that implement the services), it seems that if my composite file is not in contribution URI it is not found. Is this a restriction or is there a way to handle composite files located arbitrarily elsewhere?

IIRC this was a limitation/bug in 1.2.1, which has been fixed in trunk (see JIRA TUSCANY-2409), allowing you to do createSCANode(uri, contributions) where uri can be:

- "my/comp.composite", relative to one of the given contributions (we scan them for your composite file)

- file:///my/comp.composite or http://my.org/comp.composite, an absolute uri, we will take it as is.


2. Is there a specific program argument or programmatic way in any factories or mains to specify Tomcat versus Jetty as the embedded web server host?

Try to put tuscany-host-tomcat.jar (+ the Tomcat catalina and coyote JARs and dependency JARs) on your classpath before launching java -jar tuscany-node-launcher.jar domain.

You can also bootstrap Tuscany programmatically and register a specific Tuscany HTTP Host implementation (Jetty, Tomcat or whatever you want) in that code. Let us know if that's what you want and need sample code showing how to do it.


I grepped on "tomcat" ignore case on the source distribution but did not see to find any specific arguments.

3. How/can one specify a JAR/zip file instead with the contributions in a URI. I have not had much success if using the file:/ protocol


Try:
createSCANode(.., new SCAContribution("contrib", "file:///my/jar.jar"));
for an absolute path, or
createSCANode(.., new SCAContribution("contrib", "file:my/jar.jar"));
for a path relative to the current working dir.

JARs are supported, I don't think that Zips are (others correct me if I'm wrong here).

Hint, to get the URI syntax right I usually browse my disk to the file:///... with Firefox and copy the Firefox address bar :)

What errors did you get with the file:/ protocol?

--
Jean-Sebastien

Reply via email to