Here are some updates from my project, (source code at [1]):
1) The recovery rules, that were hard-coded at the Guardian Group, are now
described in a XML file. In this initial design, the main elements and
attributes are:
<recovery_rules>
<rule name="[RULE_NAME]" signaled_exception="[EXCEPTION_CLASS]">
<participant match="SIGNALER *or* [REGULAR_EXP] *or*![REGULAR_EXP]">
<throw_exception class="[EXCEPTION_CLASS]"
target_context="[TARGET_CONTEXT] *or *INIT_CONTEXT *or
*CURRENT_CONTEXT"
min_participant_joined="[int] *or **"
max_participant_joined="[int]* or **"/>
</participant>
</rule>
</recovery_rules>
The *<recovery_rules>* allows one or more *<rules>* to be defined. Each *
<rule>* has a *name* and the *signaled_exception*, and allows one or more *
<participant>* to be defined. The guardian group searches for the
participants that match to a regular expression defined at participant's *
match* attribute, or the participants that are equivalent to a constant
value, like "SIGNALER". Thereafter, the guardian group throws an exception,
defined at *<throw_exception class="">* element, to each participant
founded. The target context of this exception is defined at
*target_context*attribute. The target context can be a context defined
by the user, or a
context already defined by the guardian like INIT_CONTEXT and
CURRENT_CONTEXT.
The *min_participant_joined* and *max_participant_joined* are optional
attributes, that allow specifying a condition for the throw of the
exception. The former indicates the minimal number (inclusive) of
participants joined at the guardian, while the later one indicates the
maximum (exclusive).
The recovery rules for the primary-backup example can be found at [2].
2) The participants can be defined in terms of regular expression. In this
way, instead of specifying the full name of a participant (that is given by
the context list as a dot-separated sentence, like
Init_Context.Main.Primary), a regular expression that matches to a group of
participants can be used. The valid expressions are:
1. * **
2. *<Context>.**
3. *<Context>*
4. **.<Context>*
5. **.<Context>.**
6. * *.<Context>.*.<Context>.**
7. *<REG_EXP> || <REG_EXP>*
1) Any combination of contexts
2) Each participant that has a specific starter context
3 and 4) Each participant that has a specific context as the active current
context
5) Each participant that has a specific context in its context list
6) Each participant that has two specific contexts in its context list
7) Shows that the *or* logical operator (||) can be found between two or
more regular expressions
The negation operator (!) is not allowed yet. So, expressions like *!<Context>,
!<Context> || <Context>, !(<Context> || <Context>)* are not supported yet.
Any comments?
Regards,
[1]
http://svn.apache.org/repos/asf/tuscany/sandbox/dougsleite/guardian-model/
[2]
http://svn.apache.org/repos/asf/tuscany/sandbox/dougsleite/guardian-model/src/main/resources/recoveryrules.xml
--
Douglas Siqueira Leite
Graduate student at University of Campinas (Unicamp), Brazil