The following solution came to my mind. We need to use a ThreadLocal
variable + Axis2 handler combination.
We have to introduce a TenantCheckHandler which will set a ThreadLocal
boolean variable called isSuperTenantRequest to true if it is a super
tenant request & false if it is a tenant request.
Next we modify the isUltimateDestination to use this ThreadLocal as follows:
public boolean isUltimateDestination() {
return TenantCheckHandler.getTenantRequest();
}
This solution will work right?
On Fri, Jun 22, 2012 at 8:12 PM, Afkham Azeez <[email protected]> wrote:
> OK, now I realize the problem. This has been there since 2010, but we
> didn't deploy RM enabled services on the ST in Stratos AS, so we didn't see
> the problem. After the merging, things have started to fail.
>
> Let me think of a solution.
>
>
> On Fri, Jun 22, 2012 at 8:10 PM, Afkham Azeez <[email protected]> wrote:
>
>>
>> Amila has sent the following response on 26th March 2010.
>>
>> Unfortunately we can not do this since axiom method looks like this.
>>
>> .setProcessed();
>>
>> it does not allow to unset it.
>>
>> But when I am going through the code I saw Axis2 only gets the relevant
>> soap headers to do the must understand header check.
>> i.e.
>>
>> Iterator headerBlocks = envelope.getHeader().getHeadersToProcess((
>> RolePlayer)msgContext.getConfigurationContext().getAxisConfiguration().
>> getParameterValue("rolePlayer"));
>>
>> so I could solve this by setting the following RolePlayer to supper
>> tenant.
>>
>> public class SuperTenantRolePlayer implements RolePlayer{
>>
>> private List roles;
>>
>> public SuperTenantRolePlayer() {
>> this.roles = new ArrayList();
>> this.roles.add("supertenant");
>> }
>>
>> public List getRoles() {
>> return this.roles;
>>
>> }
>>
>> public boolean isUltimateDestination() {
>> return false;
>> }
>> }
>>
>> thanks,
>> Amila.
>>
>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * <http://www.apache.org/>**
> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
> *
> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
> *
> *
> *Lean . Enterprise . Middleware*
>
>
--
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* <http://www.apache.org/>**
email: **[email protected]* <[email protected]>* cell: +94 77 3320919
blog: **http://blog.afkham.org* <http://blog.afkham.org>*
twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev