Hi,
Based on the "policy-loggin" and "binding-ws-axis2-policy" modules, I have
implemented the "policy-recoveryrules" module in order to treat the recovery
rules as a policy. I have defined a xml processor
(RecoveryRulesPolicyProcessor), so I am able to read and process the data
present at definition.xml file. However, when I try to use the policy in a
composite file (e.g., <implementation.java
class="org.apache.tuscany.sca.guardian.GuardianGroupImpl"
requires="recoveryRules"/>) I get the following message:
*SEVERE: Provided Intent -
{http://www.osoa.org/xmlns/sca/1.0}recoveryRulesnot found for
PolicySet {
http://primarybackup}recoveryRulesPolicy*
*Exception in thread "main" org.osoa.sca.ServiceRuntimeException: Provided
Intent - {http://www.osoa.org/xmlns/sca/1.0}recoveryRules not found for
PolicySet {http://primarybackup}recoveryRulesPolicy*
Actually, the problem appears even the "requires="recoveryRules"" is not
defined. The presence of the definition.xml file is enough to get the
message error.
I am not sure, but I understood that an user application, in order to use
the recovery rules as polices, needs to define at the composite file the
"requires=recoveryRules" clause (as an attribute of an implementation.java
tag), and the recovery rules at the definition.xml file. Then, with my
RecoveryRulesPolicyProcessor I am able to process the definition.xml. Is it
right? Moreover, does the SCA runtime invoke the processor or I need to do
it inside my code?
Probably, I am missing something. I tried to search some example that
applies the pollicy-loggin in a composite, but I could not find. Do you know
any example that could help me?
Regards,
Source code:
#guardian-model:
http://svn.apache.org/repos/asf/tuscany/sandbox/dougsleite/guardian-model/
#policy-recoveryrules:
http://svn.apache.org/repos/asf/tuscany/sandbox/dougsleite/policy-recoveryrules/
On Thu, Jul 16, 2009 at 9:53 AM, Douglas Leite <[email protected]> wrote:
> Hi Ramkumar,
>
> At this moment I am working to implement the design proposed in this
> thread, i.e., move the recovery rules configuration file to the
> definition.xml.
>
> I will post the updates soon.
>
> Regards
>
>
> On Thu, Jul 16, 2009 at 6:30 AM, Ramkumar R <[email protected]> wrote:
>
>> Hi Douglas,
>>
>> Were you able to get this working for you, please keep posting if you have
>> any issues in doing so.
>>
>>
>> On Wed, Jul 8, 2009 at 7:40 PM, Luciano Resende <[email protected]>wrote:
>>
>>> 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://people.apache.org/%7Elresende>
>>> http://lresende.blogspot.com/
>>>
>>
>>
>>
>> --
>> Thanks & Regards,
>> Ramkumar Ramalingam
>>
>
>
>
> --
> Douglas Siqueira Leite
> Graduate student at University of Campinas (Unicamp), Brazil
>
>
--
Douglas Siqueira Leite
Graduate student at University of Campinas (Unicamp), Brazil