Monday, 15 March 2010

java - How do CDI beans behave when accessed by a JAX-WS web service? -



java - How do CDI beans behave when accessed by a JAX-WS web service? -

i want expose functionality of existing jee7 web app using soap based @webservice. can/should service inject app's cdi beans? how @requestscoped, @sessionscoped, , @applicationscoped cdi beans behave, given there's no httpservletrequest identify current session or request? ie. how looked up?

my observations:

@applicationscoped seems work expected @sessionscoped seems behave request scope in new bean created each time web service called, subsequently accessible other beans until service completes @requestscoped beans don't seem looked property - eg. if webservice injects 2 @requestscoped beans, 1 of injects other one, new instance created, rather first 1 beingness injected

my thought utilize @dependent annotation create session beans behave request beans when injected @webservice, isn't working due request scoped behaviour noted above. utilize @sessionsoped beans are, i'm concerned memory overhead since new bean created every web service request, , persist 30 minutes or so, rather beingness destroyed 1 time service has completed.

any clarification or ideas appreciated!

java web-services jsf jax-ws cdi

No comments:

Post a Comment