On Thu, May 22, 2008 at 5:21 PM, tomas darbois (JIRA) <
tuscany-dev@ws.apache.org> wrote:

>
>    [
> https://issues.apache.org/jira/browse/TUSCANY-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599068#action_12599068]
>
> tomas darbois commented on TUSCANY-2296:
> ----------------------------------------
>
> I'm facing the same problem, and I was hoping to see a solution or
> workaround , instead of reply with Work  as Designed :p
>
> I ve several composite files that are used depending on the deployement
> (used by several applications, and in various servers that aren't identical)
> and I was starting to see a good way to design it in my application,
> grouping the composites in the same place so that I was having a quicker
> control on them.
>
> I will use some tricks to workaround that problem, but it's considered for
> me as a really bad point for future enhancements of my application.
>
> > SCADomain.newInstance() processes all composites in the contribution
> irrespective of the parameter passed
> >
> ---------------------------------------------------------------------------------------------------------
> >
> >                 Key: TUSCANY-2296
> >                 URL: https://issues.apache.org/jira/browse/TUSCANY-2296
> >             Project: Tuscany
> >          Issue Type: Bug
> >          Components: Java SCA Embedded Runtime
> >    Affects Versions: Java-SCA-1.2
> >            Reporter: Vamsavardhana Reddy
> >             Fix For: Java-SCA-Next
> >
> >         Attachments: TUSCANY-2296-recreate.patch
> >
> >
> > I have two composites, namely "proper.composite" and "error.composite",
> in my test project.  "proper.composite" is used to test proper contribution
> without any errors whereas "error.composite" is used to test a problematic
> contribution.  But when I initialize a domain using SCADomain.
> newInstance("proper.composite"), I am getting an exception due to
> "error.composite".  Though it looks as if the call SCADomain.
> newInstance("proper.composite") processes only "proper.composite", in
> reality it is processing all the .composite files present in the project
> irrespective of the parameter passed to SCADomain.newInstance().
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>
I don't like the behaviour either. We have a new Node implementation [1]
that does a very similar thing to the SCADomain class but allows us to
separate the Domain configuration from the actual runtime (the Node). The
node interface is a little complicated in this particular scenario at the
moment but you can direct it toward a specific directory to read as a
contribution and read a named composite. This is useful as it removes this
behaviour where SCADomain just uses the composite name to locate a
contribution and then loads all composites there. I used this in some of our
validation tests [2]

        node = nodeFactory.createSCANode(new
File("src/main/resources/ComponentReferenceTargetNotFound/Calculator.composite").toURL().toString(),
                                 new SCAContribution("TestContribution",
                                                     new
File("src/main/resources/ComponentReferenceTargetNotFound").toURL().toString()));


We have talked about adding a helper method (from an old Node implementation
we have) that allows a simpler API

     node =
SCANode2Factory.createSCANodeWithComposite("DuplicateComponentName/Calculator.composite");

We haven't got round to this yet but I think we would make this use the
directory where Calculator.composite is as the contribution and have it load
just Calculator.composite.

Thoughts?

Simon

[1]
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/node2-api/
[2]
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/validation/src/test/java/calculator/warning/DuplicateComponentNameTestCase.java

Reply via email to