Hi Luciano,

I'm adapting my solution for the Guardian model to be integrated with the
Tuscany SCA in a better way. Previously, I was just using the SCA with the
guardian. The main elements of the model, as was already discussed before,
are the Guardian Group and the Guardian Member. The Guardian Group must be a
global entity that communicates with the Guardian Members. Each participant
has a Guardian Member associated with it.

Well, in my new design, I have implemented the Guardian Group as a
implementation type (implementation.guardian), and I am trying to implement
the Guardian Members as polices attached to the components that participate
in the cooperative action.

So, I would have something like this:

<composite>

<component name="Participant1">
<implementation.java class="" requires="guardianExceptionHandling"/>
<reference name="guardian" target="GuardianGroupComponent"/:
</component>

<component name="Participant2">
<implementation.java class="" requires="guardianExceptionHandling"/>
<reference name="guardian" target="GuardianGroupComponent"/:
 </component>

<component name="GuardianGroupComponent">
<tuscany:implementation.guardian>
<tuscany:guardianProperties
            recovery_rules="..."
            resolution_trees="..."/>
 </tuscany:implementation.guardian>
 </component>

</composite>

Every time a participant invoke a method from the GuardianGroupComponent
using a reference, the interceptor should intercept this call and invoke a
proper action. In some cases, the original operation will be invoke after
that, but in other cases not.  The action executed by the interceptor can be
some internal logic, or can be a invocation of another GuardianGroup
operation.

In other words, the communication must happen in this way: Participant <->
Guardian Member <-> Guardian Group.

So, although the participant has a direct reference to the Guardian Group
component, the communication needs to be intercepted by a Guardian Member.
Since the Guardian Member and the Guardian Group has the same operations,
every time a participant invokes a Guardian Group method, in fact it is
invoking the correspondent method in their Guardian Member.

That is what I am trying to do: to hide the existence of the guardian member
from the user.

On Tue, Oct 20, 2009 at 1:42 PM, Luciano Resende <[email protected]>wrote:

> On Tue, Oct 20, 2009 at 7:03 AM, Douglas Leite <[email protected]>
> wrote:
> > Ok,
> >
> > But let's suppose that I want to invoke, inside an invoker, a different
> > operation from a component.
> >
> > For this invocation chain:
> >
> > 1) add -> Interceptor for the add -> Interceptor for the addMethod ->
> > addMethod
> >
> > Suppose that I want to invoke the addMethod2 instead of addMetdhod, and
> both
> > operation belong to the same component. In this way, I cannot use the
> > getNext().invoke(msg);
> >
> > I am trying to create a different invoker:
> >
> >             RuntimeComponent component = msg.getTo().getComponent();
> >             ImplementationProvider implProvider =
> > component.getImplementationProvider();
> > implProvider.createInvoker(RuntimeComponentService arg1, Operation arg2);
> >
> > However, I am having some problems to create a RuntimeComponentService
> and a
> > Operation for the addMethod2. Is it possible? Am I doing the right thing,
> or
> > there is another way to do it?
> >
> > Thanks
> >
>
> What I'm trying to say is, if you specify what is the reason or the
> problem you are trying to solve, we could probably give you a better
> solution or indeed ratify you are on the right path. BTW, Look at
> operation selector in 1.x or I think JMS Binding in 2.x, this goes
> around selecting the the operation to be invoked, and this seems more
> like what you are trying to do... (e.g instead of you calling the
> operation, you just select a different one)
>
>
> --
> Luciano Resende
> http://people.apache.org/~lresende <http://people.apache.org/%7Elresende>
> http://lresende.blogspot.com/
>



-- 
Douglas Siqueira Leite
Graduate student at University of Campinas (Unicamp), Brazil

Reply via email to