You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Doug Tidwell <dt...@us.ibm.com> on 2008/06/18 15:17:15 UTC

Fw: Reworking the calculator samples

Resending to the updated address, apologies if yesterday's message 
eventually shows up here as well....
----- Forwarded by Doug Tidwell/Raleigh/IBM on 06/18/2008 09:14 AM -----

From:
Doug Tidwell/Raleigh/IBM
To:
tuscany-dev@ws.apache.org
Date:
06/17/2008 12:23 PM
Subject:
Reworking the calculator samples


Gang, I've written a graphical front-end to the calculator samples. 
There's a Swing front-end with the usual calculator buttons, and I've 
added a menu that lets you select the .composite file you want to use. I'm 
using this in a hands-on lab to emphasize that you can change the 
infrastructure beneath an application without changing the application. To 
build this, I've taken the code from the existing calculator demos and 
integrated them into a single Eclipse project.  I'm currently working on 
deploying the calculator as a Web service.

What surprised me is that whenever I run the application, I get an error 
if there's anything wrong with any .composite file in the Eclipse project. 
 My assumption was that Tuscany wouldn't load a .composite file unless I 
created an SCADomain with it.  As it is, Tuscany loads every .composite 
file it can find, then complains if something's wrong with one of them, 
whether I use that .composite file or not.  Is this an implementation 
decision, or did I miss something in the spec that says an SCA runtime 
should work this way? 

I'd appreciate any insight on this.  I'm working around the problem easily 
enough, but the behavior surprised me.  I'm using tuscany-1.1-incubating, 
fwiw.

...And yes, I'll post all the materials for the hands-on workshop soon, I 
promise.

Re: Fw: Reworking the calculator samples

Posted by Simon Laws <si...@googlemail.com>.
Hi Doug

Comments in-line...

Hope that helps

Simon

On Wed, Jun 18, 2008 at 2:17 PM, Doug Tidwell <dt...@us.ibm.com> wrote:

> Resending to the updated address, apologies if yesterday's message
> eventually shows up here as well....
> ----- Forwarded by Doug Tidwell/Raleigh/IBM on 06/18/2008 09:14 AM -----
>
> From:
> Doug Tidwell/Raleigh/IBM
> To:
> tuscany-dev@ws.apache.org
> Date:
> 06/17/2008 12:23 PM
> Subject:
> Reworking the calculator samples
>
>
> Gang, I've written a graphical front-end to the calculator samples.
> There's a Swing front-end with the usual calculator buttons, and I've
> added a menu that lets you select the .composite file you want to use. I'm
> using this in a hands-on lab to emphasize that you can change the
> infrastructure beneath an application without changing the application. To
> build this, I've taken the code from the existing calculator demos and
> integrated them into a single Eclipse project.  I'm currently working on
> deploying the calculator as a Web service.
>
> What surprised me is that whenever I run the application, I get an error
> if there's anything wrong with any .composite file in the Eclipse project.


This has been a peculiarity of the standalone SCADomain implementation for a
while. What is does when you give it the name of a composite file is search
the classpath for that file path and then it uses the directory where it
finds that file path as the contribution. This results in it loading and
validating all the composites in that contribution. It will however only run
the composite you specify. It is a little odd.



>  My assumption was that Tuscany wouldn't load a .composite file unless I
> created an SCADomain with it.  As it is, Tuscany loads every .composite
> file it can find, then complains if something's wrong with one of them,
> whether I use that .composite file or not.  Is this an implementation
> decision, or did I miss something in the spec that says an SCA runtime
> should work this way?


I know you said you are on 1.1 but if you were on 1.2 you could use the new
Node api to create a runtime and be more precise about which composite to
run. This allows you to place composites in separate contribution sub
directories. For example

SCANode2 node =
SCANode2Factory.newInstance().createSCANode("target/classesmy/contribution/myapp.composite",
new SCAContribution("test", "target/classes/mycontribution"));
node.start();
MyClient myClient = ((SCAClient)node).getService(MyClient.class,
"MyClientComponent");

Should have a similar effect. Here

"target/classes/mycontribution/myapp.composite" is the path to the node (you
can't specify the composite QName here yet but maybe in the future)
new SCAContribution("test", "target/classes/mycontribution") is the name and
location of the contribution.


>
> I'd appreciate any insight on this.  I'm working around the problem easily
> enough, but the behavior surprised me.  I'm using tuscany-1.1-incubating,
> fwiw.
>
> ...And yes, I'll post all the materials for the hands-on workshop soon, I
> promise.

Re: Reworking the calculator samples

Posted by Luciano Resende <lu...@gmail.com>.
I believe that, with the introduction of the monitors, we are already
more tolerated to composite errors. But this would only be available
partially in SCA Java 1.2 and in a more complete fashion in the
comming SCA Java 1.3 release.

On Wed, Jun 18, 2008 at 10:01 AM, Raymond Feng <en...@gmail.com> wrote:
> Hi, Doug.
>
> At this point, we scan (and load) all the composite files in the SCA
> contribution as composites can be referenced by QName. There are a few
> things we can try to optimize:
>
> 1) Make the load lazy: we will only index the composite files by reading the
> QName of the composite during the scan. Starting from a deployable composite
> (can be defined in META-INF/sca-contributions.xml), when a composite is
> referenced, we can fully load the model from XML during the resolving phase
> of the referencing artifact. (We have already taken this approach for
> WSDL/XSDs).
>
> 2) Make the load more error-tolerating: we could log errors/warnings and
> continue.
>
> Thanks,
> Raymond
> --------------------------------------------------
> From: "Doug Tidwell" <dt...@us.ibm.com>
> Sent: Wednesday, June 18, 2008 6:17 AM
> To: <de...@tuscany.apache.org>
> Subject: Fw: Reworking the calculator samples
>
>> Resending to the updated address, apologies if yesterday's message
>> eventually shows up here as well....
>> ----- Forwarded by Doug Tidwell/Raleigh/IBM on 06/18/2008 09:14 AM -----
>>
>> From:
>> Doug Tidwell/Raleigh/IBM
>> To:
>> tuscany-dev@ws.apache.org
>> Date:
>> 06/17/2008 12:23 PM
>> Subject:
>> Reworking the calculator samples
>>
>>
>> Gang, I've written a graphical front-end to the calculator samples.
>> There's a Swing front-end with the usual calculator buttons, and I've
>> added a menu that lets you select the .composite file you want to use. I'm
>> using this in a hands-on lab to emphasize that you can change the
>> infrastructure beneath an application without changing the application. To
>> build this, I've taken the code from the existing calculator demos and
>> integrated them into a single Eclipse project.  I'm currently working on
>> deploying the calculator as a Web service.
>>
>> What surprised me is that whenever I run the application, I get an error
>> if there's anything wrong with any .composite file in the Eclipse project.
>> My assumption was that Tuscany wouldn't load a .composite file unless I
>> created an SCADomain with it.  As it is, Tuscany loads every .composite
>> file it can find, then complains if something's wrong with one of them,
>> whether I use that .composite file or not.  Is this an implementation
>> decision, or did I miss something in the spec that says an SCA runtime
>> should work this way?
>>
>> I'd appreciate any insight on this.  I'm working around the problem easily
>> enough, but the behavior surprised me.  I'm using tuscany-1.1-incubating,
>> fwiw.
>>
>> ...And yes, I'll post all the materials for the hands-on workshop soon, I
>> promise.
>
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Re: Reworking the calculator samples

Posted by Raymond Feng <en...@gmail.com>.
Hi, Doug.

At this point, we scan (and load) all the composite files in the SCA 
contribution as composites can be referenced by QName. There are a few 
things we can try to optimize:

1) Make the load lazy: we will only index the composite files by reading the 
QName of the composite during the scan. Starting from a deployable composite 
(can be defined in META-INF/sca-contributions.xml), when a composite is 
referenced, we can fully load the model from XML during the resolving phase 
of the referencing artifact. (We have already taken this approach for 
WSDL/XSDs).

2) Make the load more error-tolerating: we could log errors/warnings and 
continue.

Thanks,
Raymond
--------------------------------------------------
From: "Doug Tidwell" <dt...@us.ibm.com>
Sent: Wednesday, June 18, 2008 6:17 AM
To: <de...@tuscany.apache.org>
Subject: Fw: Reworking the calculator samples

> Resending to the updated address, apologies if yesterday's message
> eventually shows up here as well....
> ----- Forwarded by Doug Tidwell/Raleigh/IBM on 06/18/2008 09:14 AM -----
>
> From:
> Doug Tidwell/Raleigh/IBM
> To:
> tuscany-dev@ws.apache.org
> Date:
> 06/17/2008 12:23 PM
> Subject:
> Reworking the calculator samples
>
>
> Gang, I've written a graphical front-end to the calculator samples.
> There's a Swing front-end with the usual calculator buttons, and I've
> added a menu that lets you select the .composite file you want to use. I'm
> using this in a hands-on lab to emphasize that you can change the
> infrastructure beneath an application without changing the application. To
> build this, I've taken the code from the existing calculator demos and
> integrated them into a single Eclipse project.  I'm currently working on
> deploying the calculator as a Web service.
>
> What surprised me is that whenever I run the application, I get an error
> if there's anything wrong with any .composite file in the Eclipse project.
> My assumption was that Tuscany wouldn't load a .composite file unless I
> created an SCADomain with it.  As it is, Tuscany loads every .composite
> file it can find, then complains if something's wrong with one of them,
> whether I use that .composite file or not.  Is this an implementation
> decision, or did I miss something in the spec that says an SCA runtime
> should work this way?
>
> I'd appreciate any insight on this.  I'm working around the problem easily
> enough, but the behavior surprised me.  I'm using tuscany-1.1-incubating,
> fwiw.
>
> ...And yes, I'll post all the materials for the hands-on workshop soon, I
> promise.