You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "lukasz.czerpak" <lu...@czerpak.eu> on 2010/05/27 21:35:00 UTC

PerRequestFactory/PooledFactory with Spring configuration and JAX-WS frontend

Hi,

I have some jaxws webservices configured in spring's applicationContext.xml
like this:

    <jaxws:endpoint implementor="eu.czerpak.AccountImpl" address="/Account"
/>

Everything works fine, but i have requirement to have per-request instance
of service. After some research on this mailling list i found that
PerRequestFactory or PooledFactory would be the best fit solution. The only
trouble is how to set up in applicationContext.xml - i don't know spring and
don't know how to do it.
Could someone help me with it, please?

regards,
Lukasz Czerpak

-- 
View this message in context: http://old.nabble.com/PerRequestFactory-PooledFactory-with-Spring-configuration-and-JAX-WS-frontend-tp28698899p28698899.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: PerRequestFactory/PooledFactory with Spring configuration and JAX-WS frontend

Posted by "lukasz.czerpak" <lu...@czerpak.eu>.

dkulp wrote:
> 
> 
> Actually, if using Spring and it's context filter and such, it's probably 
> easier to use the Spring AOP proxies and it's scopes.
> 
> 
> <bean id="myImpl"  class="eu.czerpak.AccountImp" scope="session"> 
>   <aop:scoped-proxy /> 
> </bean> 
> 
> <jaxws:endpoint implementor="#myImpl" address="/Account" />
> 
> Spring would automatically handle creating new instances per session.
> 
> Dan
> 

Thank you very much!!! It works now perfectly!

Do you know is it would have big impact on performance if i use
scope="prototype"?

regards,
Lukasz Czerpak


-- 
View this message in context: http://old.nabble.com/PerRequestFactory-PooledFactory-with-Spring-configuration-and-JAX-WS-frontend-tp28698899p28699526.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: PerRequestFactory/PooledFactory with Spring configuration and JAX-WS frontend

Posted by Daniel Kulp <dk...@apache.org>.
Actually, if using Spring and it's context filter and such, it's probably 
easier to use the Spring AOP proxies and it's scopes.


<bean id="myImpl"  class="eu.czerpak.AccountImp" scope="session"> 
  <aop:scoped-proxy /> 
</bean> 

<jaxws:endpoint implementor="#myImpl" address="/Account" />

Spring would automatically handle creating new instances per session.

Dan



On Thursday 27 May 2010 3:35:00 pm lukasz.czerpak wrote:
> Hi,
> 
> I have some jaxws webservices configured in spring's applicationContext.xml
> like this:
> 
>     <jaxws:endpoint implementor="eu.czerpak.AccountImpl" address="/Account"
> />
> 
> Everything works fine, but i have requirement to have per-request instance
> of service. After some research on this mailling list i found that
> PerRequestFactory or PooledFactory would be the best fit solution. The only
> trouble is how to set up in applicationContext.xml - i don't know spring
> and don't know how to do it.
> Could someone help me with it, please?
> 
> regards,
> Lukasz Czerpak

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog