synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saminda Abeyruwan <sami...@opensource.lk>
Subject Re: Mediators require unique MessageContexts?
Date Fri, 14 Oct 2005 05:17:14 GMT
Hi,

As Deepal said, we can think Mediators as bunch of special services 
living in a service group. If mediators need to share some state accorss 
them, they can use the exiting ServiceGroupContext and stored in the MC.

The life cycle of the MC is per Message basis in Axis2. So withing the 
Axis Engine, if we need to loop again we need to have a fresh MC with 
the old MC's ServiceGroupContext ID as a reference parameter. Thus, when 
the Axis Engine invoke again, it goes throught our SyanpseDispatcher, 
DispatchingChecker and InstanceDispatcher to full up the correct context 
for that rule. So it's always better to have fresh MC.

Saminda

> Hi all;
>
>  
>
> To me invoking multiple mediators for one request is like invoking 
> multiple services in a serviceGroup (in axis2) , therefore if 
> mediators want to share some properties or whatever , they can use 
> ServiceGroupContext to do so not the MC.
>
>  
>
> In Axis2 MC is for one invocation , if some handlers in a flow want to 
> share some data they can use MC to do store them, on the other hand is 
> Axis2 dispatching depends on Descriptions and Contexts are in MC 
> (ServiceDescription , OperationDescription , OperationContext , 
> ServiceContext) , there for it would be better if we can use fresh MC 
> for each Mediator invocation.
>
>
> Thanks,
>  Deepal
>
> ................................................................
> ~Future is Open~
>
>     ----- Original Message -----
>     *From:* ant elder <mailto:ant.elder@gmail.com>
>     *To:* synapse-dev@ws.apache.org <mailto:synapse-dev@ws.apache.org>
>     *Sent:* Friday, October 14, 2005 3:19 AM
>     *Subject:* Mediators require unique MessageContexts?
>
>     A question I asked on the IRC was does each mediator invocation
>     really need a its own MessageContext instance.
>
>     I still don't understand why the MC can't be reused amongst
>     mediator invocations? What am I missing here, whats in each MC
>     that wont be copied or mustn't be shared? Wouldn't it be quite a
>     bit more efficient to have each mediator work against the one MC?
>
>     Maybe this answer depends on the answer to 'are mediators
>     services' question.
>
>        ...ant
>


Mime
View raw message