Indika,

I agree about the other mediators, but XSLT this cannot be done I guess.

being able to cache multiple templates on its own would not solve the
problem as it requires some indexing mechanism. In dynamic key case, the
XSLT is going be dynamic and caching the template with a key expression will
not work, I expect caching over the evaluated XSLT is not going to be that
effective too.

Ruwan

On Fri, Jan 7, 2011 at 9:53 AM, indika kumara <[email protected]> wrote:

> I have not checked the code. But I believe it is possible to modify the
> XSLT mediator to cache multiple templates. In the worst case, caching
> multiple transformer instances. We have to evaluate tradeoff between a
> mediator with multiple transformer (or templates) instances vs multiple
> mediator instances.
>
> BTW, the use case at [1] might be worth : use a single validate mediator
> instead of a filter mediator + multiple validate mediators. That applies for
> many mediators.
>
>
> Thanks,
>
> Indika
>
> [1] http://wso2.org/forum/thread/10462
>
> On Fri, Jan 7, 2011 at 7:21 AM, Ruwan Linton <[email protected]>wrote:
>
>> I agree with Paul 100%.
>>
>> Supun/Ranga, if you carefully look at the XSLT mediator, it caches the
>> XSLT template, template creation in XSLT (basically compiling it) is an
>> expensive task, with this approach we cannot cache the XSLT as the XSLT is
>> dynamic in this case.
>>
>> Thanks,
>> Ruwan
>>
>>
>> On Thu, Jan 6, 2011 at 3:44 PM, Paul Fremantle <[email protected]> wrote:
>>
>>> Ok. I can see a few scenarios where this might be useful, but in
>>> general if there are a well-defined set of XSLTs (e.g. say we are
>>> choosing between 10) it would be more efficient to have separate
>>> mediators because they will do the initialization and this might
>>> include a compilation step for the XSLT.
>>>
>>> Paul
>>>
>>> On Thu, Jan 6, 2011 at 10:03 AM, Supun Kamburugamuva <[email protected]>
>>> wrote:
>>> > As an example lets take a XSLT transformation.
>>> >
>>> > Depending on the message content user may have several XSLT
>>> > transformations specified.
>>> >
>>> > With the current language user has to have several XSLT mediators
>>> > refereeing these XSLT's.
>>> >
>>> > But by calculating the XSLT key dynamically based on the message
>>> > content, user can use only one XSLT mediator.
>>> >
>>> > Thanks,
>>> > Supun..
>>> >
>>> > On Thu, Jan 6, 2011 at 2:24 PM, Paul Fremantle <[email protected]>
>>> wrote:
>>> >> Can you give an example use-case?
>>> >>
>>> >> Thanks
>>> >> Paul
>>> >>
>>> >> On Thu, Jan 6, 2011 at 7:18 AM, Ranga Siriwardena <[email protected]>
>>> wrote:
>>> >>> Hi All,
>>> >>>
>>> >>> Currently we are supporting only static registry keys with mediators.
>>> >>> For an example, XSLT Mediators only allows static keys when creating
>>> >>> the mediator. How about having dynamic keys with these kind of
>>> >>> mediators. In that case we can support dynamic keys and with that,
>>> >>> user will able to use XPath kind of approach to dynamically generate
>>> >>> the key instead of a static key. WDYT?
>>> >>>
>>> >>> Following is an example for that.
>>> >>>
>>> >>> <!-- using static key -->
>>> >>> <xslt key="xslt-key-req"/>
>>> >>>
>>> >>> <!-- using Dynamic key -->
>>> >>> <xslt key={ } />
>>> >>>
>>> >>> If we are supporting this kind of dynamic key approach, what should
>>> be
>>> >>> the proper way of representing the dynamic key?
>>> >>> Thoughts are welcome.
>>> >>>
>>> >>> Thank You.
>>> >>>
>>> >>> --
>>> >>> Ranga Siriwardena
>>> >>> Software Engineer
>>> >>> WSO2 Inc.
>>> >>>
>>> >>> ---------------------------------------------------------------------
>>> >>> To unsubscribe, e-mail: [email protected]
>>> >>> For additional commands, e-mail: [email protected]
>>> >>>
>>> >>>
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Paul Fremantle
>>> >> Co-Founder and CTO, WSO2
>>> >> Apache Synapse PMC Chair
>>> >> OASIS WS-RX TC Co-chair
>>> >>
>>> >> blog: http://pzf.fremantle.org
>>> >> [email protected]
>>> >>
>>> >> "Oxygenating the Web Service Platform", www.wso2.com
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: [email protected]
>>> >> For additional commands, e-mail: [email protected]
>>> >>
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > Technical Lead, WSO2 Inc
>>> > http://wso2.org
>>> > supunk.blogspot.com
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: [email protected]
>>> > For additional commands, e-mail: [email protected]
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Paul Fremantle
>>> Co-Founder and CTO, WSO2
>>> Apache Synapse PMC Chair
>>> OASIS WS-RX TC Co-chair
>>>
>>> blog: http://pzf.fremantle.org
>>> [email protected]
>>>
>>> "Oxygenating the Web Service Platform", www.wso2.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>
>>
>> --
>> Ruwan Linton
>> Software Architect & Product Manager
>>
>> WSO2 Inc.; http://wso2.org
>>
>> Lean . Enterprise . Middleware
>>
>> phone: +1 408 754 7388 ext 51789
>> email: [email protected]; cell: +94 77 341 3097
>> blog: http://blog.ruwan.org
>> linkedin: http://www.linkedin.com/in/ruwanlinton
>> google: http://www.google.com/profiles/ruwan.linton
>> tweet: http://twitter.com/ruwanlinton
>>
>
>


-- 
Ruwan Linton
Software Architect & Product Manager
WSO2 Inc.; http://wso2.org

Lean . Enterprise . Middleware

phone: +1 408 754 7388 ext 51789
email: [email protected]; cell: +94 77 341 3097
blog: http://blog.ruwan.org
linkedin: http://www.linkedin.com/in/ruwanlinton
google: http://www.google.com/profiles/ruwan.linton
tweet: http://twitter.com/ruwanlinton

Reply via email to