• 1 reply
  • Latest Post - ‏2013-03-19T14:13:05Z by SystemAdmin
139 Posts

Pinned topic Master Slave example with java class or with one vm-template???

‏2013-03-19T10:49:46Z |
Can anyone provide me the example of master-slave with java class which extends TopologyProvider class??
means creation of vm-templates by java class specialy of link creation??

Can i have master component, slave component and link component in one vm template??? rather than having three templates with if -- else different conditions

I am able to merge template of master and slave but not link ,can we put like this??

Please kindly revert.

Sheetal Chavan
Updated on 2013-03-19T14:13:05Z at 2013-03-19T14:13:05Z by SystemAdmin
  • SystemAdmin
    139 Posts

    Re: Master Slave example with java class or with one vm-template???


    Either you use a templateTransformer based on vm-template or you use your own transformer to create the topology.

    If you look at the hello example, you will see in the comments:

    <scr:component xmlns:scr="" immediate="false" name="Hello">
    <!-- implementation element determines whether trnasform is Java or Velocity template. -->
    <implementation class=""/>
    <!-- implementation class=""/ Java transform -->
    <provide interface=""/>
    <!-- {component,link}.template properties used only for template transforms; ignored/not needed for Java transforms. -->
    <property name="component.template" type="String" value="templates/hello.vm"/>

    So, the property "component.template" and "link.template" is only used when you use the TemplateTransformer not when you create your own transformer extending the TopologyProvider.

    Then if you create your own TopologyProvider, nothing prevent you (AFAIK), to create a class that generate the topology for your master/slave and link at once.

    Not sure about the ability to merge the link template with the two others, but if I had to try it, I would add the link tempalte as being the last element of the vm-templates array.


    Dominique - Follow me on Twitter @ITDoVe - Blog: