You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Stefan Lischke <li...@googlemail.com> on 2008/09/15 16:31:13 UTC

howto avoid service isolation

Hi,

I have two Services, that needs to share a cache. How can i avoid service isolation so that both
service are using the same object?

thx in advance

Stefan


RE: howto avoid service isolation

Posted by Martin Gainty <mg...@hotmail.com>.
how is your code structured?
are you implementing 2 different axis2 servlets?
or 2 different aars?

Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 


> Subject: RE: howto avoid service isolation
> Date: Mon, 15 Sep 2008 20:11:00 +0530
> From: smoitra@cisco.com
> To: axis-user@ws.apache.org
> 
> I too have the same use case.
> I tried it with the get/set attributes, but could not make it work.
> Any advice on this will be very helpful.
> Thanks,
> Subhro. 
> 
> -----Original Message-----
> From: Stefan Lischke [mailto:lischke@googlemail.com] 
> Sent: Monday, September 15, 2008 8:01 PM
> To: axis-user@ws.apache.org
> Subject: howto avoid service isolation
> 
> Hi,
> 
> I have two Services, that needs to share a cache. How can i avoid
> service isolation so that both service are using the same object?
> 
> thx in advance
> 
> Stefan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 

_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/

RE: howto avoid service isolation

Posted by "Subhro Moitra (smoitra)" <sm...@cisco.com>.
I too have the same use case.
I tried it with the get/set attributes, but could not make it work.
Any advice on this will be very helpful.
Thanks,
Subhro. 

-----Original Message-----
From: Stefan Lischke [mailto:lischke@googlemail.com] 
Sent: Monday, September 15, 2008 8:01 PM
To: axis-user@ws.apache.org
Subject: howto avoid service isolation

Hi,

I have two Services, that needs to share a cache. How can i avoid
service isolation so that both service are using the same object?

thx in advance

Stefan


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: howto avoid service isolation

Posted by Stefan Lischke <li...@googlemail.com>.
Deepal jayasinghe wrote:
> Stefan Lischke wrote:
>> Thanx for your answer,
>>
>> i tried using the ConfigurationContext, but when i put in an object from Service 1 and read it out
>> from Service 2 i get a ClassCastException when casting it to the right class.
>>   
> Yes thats happen because of service isolation. Each service classes are
> loaded from different class loader. To avoid that problem you have to
> put that common class into a common place like lib directory.

ok thanx for help, thats what i done and it works like perfect.

Stefan



Re: howto avoid service isolation

Posted by Deepal jayasinghe <de...@gmail.com>.
Stefan Lischke wrote:
> Thanx for your answer,
>
> i tried using the ConfigurationContext, but when i put in an object from Service 1 and read it out
> from Service 2 i get a ClassCastException when casting it to the right class.
>   
Yes thats happen because of service isolation. Each service classes are
loaded from different class loader. To avoid that problem you have to
put that common class into a common place like lib directory.
> Maybe thats because the different class-loaders? So i can only use simple java types to share
> between both services? how can i share instances of my classes? do i have to put them in a lib in
> the axis2/lib directory?
>
> thanx for helping
>
> Stefan
>
> Deepal jayasinghe wrote:
>   
>> You can make them to a service group and then from the serviced group
>> context you can share. Or you can put what you want to share into
>> configuration context.
>>
>> -Deepal
>>     
>>> Hi,
>>>
>>> I have two Services, that needs to share a cache. How can i avoid service isolation so that both
>>> service are using the same object?
>>>
>>> thx in advance
>>>
>>> Stefan
>>>
>>>   
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>     
>
>
>   


-- 
Thank you!


http://blogs.deepal.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: howto avoid service isolation

Posted by Stefan Lischke <li...@googlemail.com>.
Thanx for your answer,

i tried using the ConfigurationContext, but when i put in an object from Service 1 and read it out
from Service 2 i get a ClassCastException when casting it to the right class.

Maybe thats because the different class-loaders? So i can only use simple java types to share
between both services? how can i share instances of my classes? do i have to put them in a lib in
the axis2/lib directory?

thanx for helping

Stefan

Deepal jayasinghe wrote:
> You can make them to a service group and then from the serviced group
> context you can share. Or you can put what you want to share into
> configuration context.
> 
> -Deepal
>> Hi,
>>
>> I have two Services, that needs to share a cache. How can i avoid service isolation so that both
>> service are using the same object?
>>
>> thx in advance
>>
>> Stefan
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 



Re: howto avoid service isolation

Posted by Deepal jayasinghe <de...@gmail.com>.
You can make them to a service group and then from the serviced group
context you can share. Or you can put what you want to share into
configuration context.

-Deepal
> Hi,
>
> I have two Services, that needs to share a cache. How can i avoid service isolation so that both
> service are using the same object?
>
> thx in advance
>
> Stefan
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org