On Tue, Mar 2, 2010 at 3:41 PM, Wayne Keenan <[email protected]> wrote:
>
> Hi,
>
> I am using Tuscany 1.6 and am trying to get start all composites on the
> classpath to start using the no-arg newInstance() method of the SCADomain;
> the probem is only the 1st (w.r.t. classpath ordering) is ever started.
> 'main' is basically just:
>
> org.apache.tuscany.sca.host.embedded.SCADomain.newInstance();
>
>
> I currently only have 2 composites and only 'A' will start if the class
> path is:
>
> dirA/META-INF/sca-deployables/a.composite
> dirB/META-INF/sca-deployables/b.composite
>
>
> If I reorder the classpath to be dirB/*...:dirA/*... then B will start
> and not A.
>
> Please could someone help me understand if there is something missing in
> what I am doing? or if what I am doing is just wrong?
>
Just from a quick look, it seems we are looking for artifacts that
starts with META-INF/sca-deployables
// Add all composites under META-INF/sca-deployables to the
// list of deployables
String prefix = Contribution.SCA_CONTRIBUTION_DEPLOYABLES;
for (Artifact artifact : contribution.getArtifacts()) {
if (artifact.getModel() instanceof Composite) {
if (artifact.getURI().startsWith(prefix)) {
Composite composite = (Composite)artifact.getModel();
if (!contribution.getDeployables().contains(composite)) {
contribution.getDeployables().add(composite);
}
}
}
}
>From your folder structure, it seems that you have dirA and dirB which
will fail this... or maybe it seems that you are trying to contribute
two contributions and then what I'm saying would not apply...
Could you post the initialization code around the SCADomain ? Also,
could you try adding a sca-contribution.xml to see if that workaround
the issue you are having.
--
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/