On Wed, Jul 8, 2009 at 4:38 AM, Ramkumar R<[email protected]> wrote:
> On Mon, Jul 6, 2009 at 10:52 PM, Douglas Leite <[email protected]> wrote:
>>
>> How does it work? In the composite file I would use
>> requires="recoveryRules, but how about the definitions.xml file? Is there a
>> way to set the configurations like the recovery rules XML file is defined?
>> (take a look at [1])
>>
>> [1]
>> http://svn.apache.org/repos/asf/tuscany/sandbox/dougsleite/guardian-model/src/main/resources/recoveryrules.xml
>
> Hi Douglas,
>
> You can define a policySet in definition.xml for the recovery rules as shown
> below...
>
> <policySet name="RecoveryPolicy" provides="tuscany:recoveryRules"
> appliesTo="sca:implementation.java"
>         xmlns="http://www.osoa.org/xmlns/sca/1.0";>
>         <tuscany:recovery_rules>
>             <tuscany:rule name="Rule1"
> signaled_exception="org.apache.tuscany.sca.guardian.JoinException">
>                 <tuscany:participant match="SIGNALER">
>                     <tuscany:throw_exception
> class="org.apache.tuscany.sca.guardian.itests.primaryBackup.common.PrimaryExistsException"
> target_context="MAIN" min_participant_joined="2"/>
>                 </tuscany:participant>
>                 <tuscany:participant match="!SIGNALER">
>                     <tuscany:throw_exception
> class="org.apache.tuscany.sca.guardian.itests.primaryBackup.common.BackupJoinedException"
> target_context="PRIMARY" min_participant_joined="2"/>
>                 </tuscany:participant>
>             </tuscany:rule>
>         </tuscany:recovery_rules>
> </policySet>
>

You will also need to define a ArtifactProcessor to read the elements
you have defined for the policySet, see the policy logging for a
simple example of a artifact processor that reads configurations from
a policySet.



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

Reply via email to