On Mon, Feb 9, 2009 at 6:41 AM, Rohan Sahgal <[email protected]> wrote:

> I would like to write such a tool.
>
> Can you point me to the correct place in the Tuscany source code from
> where I could reuse the functionality.
>
> Thanks,
> Rohan
>
snip...

Hi Rohan

If you want to get your hands dirty an knock up a tool to do composite
validation then the code is fairly easy to find. Which bits you use depends
on how much validation you want to use. There are a number of steps the code
goes through.

- Read the composite xml - create a internal model of the XML from the
composite file
- resolve the composite - find all the things that the composite refers to
such as Java component implementation files and WSDL interface defintions
- build the composite - fix up the internal model to ensure that it is valid
and ready to be activated as an SCA composite application

In each of these stages validation errors can be raised. Our code uses a
"monitor" where errors are lodged. After each stage the monitor is asked to
report any errors that have been found.

The code is all kicked off from the NodeImpl class [1]. Take a look at the
initRuntime() method to see how the runtime is set up. The configureNode()
method controls the various read(), resolve() and build stages().

The read() and resolve() stages rely on the various Tuscany specific  XML
processors you will see in out code base, for example, the ones that
read/resolve the assembly model can be found here [2]. Take a look at the
unit  tests in the assembly-xml module [3] to get a feel for how the
processors are used.

Let us know when you need more info.

Regards

Simon

[1]
http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
[2]
http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/modules/assembly-xml/
[3]
http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/

Reply via email to