On Sun, Jun 26, 2011 at 6:00 AM, Nirmal Fernando
<[email protected]> wrote:
>
>
> On Sat, Jun 25, 2011 at 10:02 PM, Luciano Resende <[email protected]>
> wrote:
>>
>> On Sat, Jun 25, 2011 at 5:54 AM, Nirmal Fernando
>> <[email protected]> wrote:
>> > Hi All,
>> >
>> > I need your help to decide how should Composite Diagram Generator loads
>> > composite XML.
>> > I can see two main options:
>> >
>> > 1) Load from the Jar file
>> > 2) Directly load the composite XML (i.e. user gives it as the input)
>> >
>> > Thanks.
>> >
>>
>> How do you plan to run the tool that loads the composite diagram ?
>
> Currently the tool runs independently. It gets the composite XML as the
> input and
> outputs the composite diagram.
>
> To load the composite diagram Ant suggested me to use Tuscany which makes
> implementation easier.
> So the issue I have is whether to load the composite XML using jar file is
> better than directly loading composite XML (By the way, is this possible
> with Tuscany?).
>
> Highly appreciate your ideas!
>

You can load just a composite from XML using the Tuscany Deployer
which you can get from the TuscanyRuntime of NodeFactory, eg:

     Deployer deployer = TuscanyRuntime.newInstance().getDeployer();
     Composite composite = deployer.loadXMLDocument(new
FileReader("/some/composite.xml"));

The difference between that and the code I showed earlier using a Node
to load it from a contribution jar is that loadXMLDocument() wont do
any resolving or building so the returned model isn't complete. What
that means is that things like component types wont have been
introspected, eg if the composite contains a component which uses
<implementation.java class="sample.Helloworld" /> then you wont be
able to see what services, references, or properties is has. For your
diagram generation i'd have thought those are needed so the approach
using the contribution jars not the individual artifacts seems better.

   ...ant

Reply via email to