You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2011/02/06 21:01:54 UTC

setServiceBean on JAX-RS in 2.3.2

It seems as if my code that was successful at using a singleton object
for a service bean via   sf.setServiceBean(coordinatorService) has
stopped working. New objects are being created for each request.

Re: setServiceBean on JAX-RS in 2.3.2

Posted by Benson Margulies <bi...@gmail.com>.
I can live with eliminating the extra call.

On Mon, Feb 7, 2011 at 5:34 AM, Sergey Beryozkin <sb...@gmail.com> wrote:
> Hi Benson
>
> I've done a quick test, I believe you're probably doing
>
> setServiceClass and setServiceBean() calls. I've added the javadocs
> recently, the setServiceBean() was added for Spring handlers to inject an
> instantiated bean and it was added after setServiceClass() and
> setResourceProvider() methods had been introduced. If you prefer calling
> setServiceBean() programmatically then please avoid calling
> setServiceClass().
> I'll update the docs, and if you feel calling setServiceClass() should not
> have sideeffect when setServiceBean() is called then please open a JIRA :-)
>
> cheers, Sergey
>
> On Sun, Feb 6, 2011 at 8:01 PM, Benson Margulies <bi...@gmail.com>wrote:
>
>> It seems as if my code that was successful at using a singleton object
>> for a service bean via   sf.setServiceBean(coordinatorService) has
>> stopped working. New objects are being created for each request.
>>
>

Re: setServiceBean on JAX-RS in 2.3.2

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Benson

I've done a quick test, I believe you're probably doing

setServiceClass and setServiceBean() calls. I've added the javadocs
recently, the setServiceBean() was added for Spring handlers to inject an
instantiated bean and it was added after setServiceClass() and
setResourceProvider() methods had been introduced. If you prefer calling
setServiceBean() programmatically then please avoid calling
setServiceClass().
I'll update the docs, and if you feel calling setServiceClass() should not
have sideeffect when setServiceBean() is called then please open a JIRA :-)

cheers, Sergey

On Sun, Feb 6, 2011 at 8:01 PM, Benson Margulies <bi...@gmail.com>wrote:

> It seems as if my code that was successful at using a singleton object
> for a service bean via   sf.setServiceBean(coordinatorService) has
> stopped working. New objects are being created for each request.
>