You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Chris Campbell <cc...@quaris.com> on 2007/08/21 19:43:37 UTC
POJO service lifecycle
I have a POJO web service configured as a jaxws endpoint in a
servlet container.
<jaxws:endpoint id="someService"
implementor="test.SomeServiceImpl"
address="/SomeService" />
The implementor needs to be informed when it is shutdown, how do I
get CXF to do this?
Re: [U] RE: POJO service lifecycle
Posted by Willem Jiang <ni...@iona.com>.
Yes,
They are same to each other and mean the spring beans' reference.
CXF just pass the bean's reference to the service implementor variable.
Willem.
Ridgway, Jamie Mr CONT USAAC wrote:
> UNCLASSIFIED////
>
>
> So did I.
>
> I solved the same problem using
>
> <bean id="SomeServiceImpl" class="test.SomeServiceImpl"/>
>
> <jaxws:endpoint id="someService"
> address="/SomeService" >
> <jaxws:implementor><ref bean="SomeServiceImpl"/></jaxws:implementor>
> </jaxws:endpoint>
>
>
> Does anyone know if the #implementor notation is just a shorthand way of
> above endpoint def or is there something different between the two?
>
> Thanks,
> Jamie
>
> -----Original Message-----
> From: Ray Krueger [mailto:raykrueger@gmail.com]
> Sent: Tuesday, August 21, 2007 4:19 PM
> To: cxf-user@incubator.apache.org
> Subject: Re: POJO service lifecycle
>
> Aaah yeah absolutely.
> And now I learned something too hehe. I had wondered what the
> #implementor stuff was I saw in some peoples emails...
>
> On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
>
>> Works! Thanks. Only thing I had to do was add a bean definition for
>> the implementor, then reference that bean in the implementor attribute
>>
>
>
>> for the jaxws:endpoint - previously I just had the jaxws:endpoint in
>> the config...
>>
>> so I now have
>>
>> <bean id="SomeServiceImpl" class="test.SomeServiceImpl"/>
>>
>> <jaxws:endpoint id="someService"
>> implementor="#SomeServiceImpl"
>> address="/SomeService" />
>>
>> Where test.SomeServiceImpl implements DisposableBean
>>
>> Thanks again.
>>
>>
>> Ray Krueger wrote:
>>
>>> Spring is used behind the scenes for everything in CXF though. You
>>> should be able to implement those. Again, if you're willing to and
>>> it makes sense.
>>>
>>> I'm also totally guessing on this, give it a shot, see if it works
>>> :)
>>>
>>>
>>> On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
>>>
>>>> I am using the CXFServlet to load the endpoints, so the spring
>>>> interfaces do not work. Is there a CXF way to do this?
>>>>
>>>> Ray Krueger wrote:
>>>>
>>>>> You can probably implement Spring's InitializingBean and
>>>>> DisposableBean interfaces. Those are called during the BeanFactory
>>>>>
>
>
>>>>> lifecycle.
>>>>> http://www.springframework.org/docs/api/org/springframework/beans/
>>>>> factory/InitializingBean.html
>>>>> http://www.springframework.org/docs/api/org/springframework/beans/
>>>>> factory/DisposableBean.html
>>>>>
>>>>> This implies that Spring is instantiating your impl, and not cxf.
>>>>> I'm not sure if that's the case though. This also implies that
>>>>> your ok with implementing Spring interfaces :P
>>>>>
>>>>>
>>>>> On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
>>>>>
>>>>>> I have a POJO web service configured as a jaxws endpoint in a
>>>>>> servlet container.
>>>>>>
>>>>>> <jaxws:endpoint id="someService"
>>>>>> implementor="test.SomeServiceImpl"
>>>>>> address="/SomeService" />
>>>>>>
>>>>>> The implementor needs to be informed when it is shutdown, how do
>>>>>> I get CXF to do this?
>>>>>>
>>>>>>
>
> UNCLASSIFIED////
>
>
[U] RE: POJO service lifecycle
Posted by "Ridgway, Jamie Mr CONT USAAC" <JA...@USAAC.ARMY.MIL>.
UNCLASSIFIED////
So did I.
I solved the same problem using
<bean id="SomeServiceImpl" class="test.SomeServiceImpl"/>
<jaxws:endpoint id="someService"
address="/SomeService" >
<jaxws:implementor><ref bean="SomeServiceImpl"/></jaxws:implementor>
</jaxws:endpoint>
Does anyone know if the #implementor notation is just a shorthand way of
above endpoint def or is there something different between the two?
Thanks,
Jamie
-----Original Message-----
From: Ray Krueger [mailto:raykrueger@gmail.com]
Sent: Tuesday, August 21, 2007 4:19 PM
To: cxf-user@incubator.apache.org
Subject: Re: POJO service lifecycle
Aaah yeah absolutely.
And now I learned something too hehe. I had wondered what the
#implementor stuff was I saw in some peoples emails...
On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
> Works! Thanks. Only thing I had to do was add a bean definition for
> the implementor, then reference that bean in the implementor attribute
> for the jaxws:endpoint - previously I just had the jaxws:endpoint in
> the config...
>
> so I now have
>
> <bean id="SomeServiceImpl" class="test.SomeServiceImpl"/>
>
> <jaxws:endpoint id="someService"
> implementor="#SomeServiceImpl"
> address="/SomeService" />
>
> Where test.SomeServiceImpl implements DisposableBean
>
> Thanks again.
>
>
> Ray Krueger wrote:
> > Spring is used behind the scenes for everything in CXF though. You
> > should be able to implement those. Again, if you're willing to and
> > it makes sense.
> >
> > I'm also totally guessing on this, give it a shot, see if it works
> > :)
> >
> >
> > On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
> >> I am using the CXFServlet to load the endpoints, so the spring
> >> interfaces do not work. Is there a CXF way to do this?
> >>
> >> Ray Krueger wrote:
> >>> You can probably implement Spring's InitializingBean and
> >>> DisposableBean interfaces. Those are called during the BeanFactory
> >>> lifecycle.
> >>> http://www.springframework.org/docs/api/org/springframework/beans/
> >>> factory/InitializingBean.html
> >>> http://www.springframework.org/docs/api/org/springframework/beans/
> >>> factory/DisposableBean.html
> >>>
> >>> This implies that Spring is instantiating your impl, and not cxf.
> >>> I'm not sure if that's the case though. This also implies that
> >>> your ok with implementing Spring interfaces :P
> >>>
> >>>
> >>> On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
> >>>> I have a POJO web service configured as a jaxws endpoint in a
> >>>> servlet container.
> >>>>
> >>>> <jaxws:endpoint id="someService"
> >>>> implementor="test.SomeServiceImpl"
> >>>> address="/SomeService" />
> >>>>
> >>>> The implementor needs to be informed when it is shutdown, how do
> >>>> I get CXF to do this?
> >>>>
> >
>
UNCLASSIFIED////
Re: POJO service lifecycle
Posted by Ray Krueger <ra...@gmail.com>.
Aaah yeah absolutely.
And now I learned something too hehe. I had wondered what the
#implementor stuff was I saw in some peoples emails...
On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
> Works! Thanks. Only thing I had to do was add a bean definition for
> the implementor, then reference that bean in the implementor
> attribute for the jaxws:endpoint - previously I just had the
> jaxws:endpoint in the config...
>
> so I now have
>
> <bean id="SomeServiceImpl" class="test.SomeServiceImpl"/>
>
> <jaxws:endpoint id="someService"
> implementor="#SomeServiceImpl"
> address="/SomeService" />
>
> Where test.SomeServiceImpl implements DisposableBean
>
> Thanks again.
>
>
> Ray Krueger wrote:
> > Spring is used behind the scenes for everything in CXF though. You
> > should be able to implement those. Again, if you're willing to and it
> > makes sense.
> >
> > I'm also totally guessing on this, give it a shot, see if it works :)
> >
> >
> > On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
> >> I am using the CXFServlet to load the endpoints, so the spring
> >> interfaces do not work. Is there a CXF way to do this?
> >>
> >> Ray Krueger wrote:
> >>> You can probably implement Spring's InitializingBean and
> >>> DisposableBean interfaces. Those are called during the BeanFactory
> >>> lifecycle.
> >>> http://www.springframework.org/docs/api/org/springframework/beans/factory/InitializingBean.html
> >>> http://www.springframework.org/docs/api/org/springframework/beans/factory/DisposableBean.html
> >>>
> >>> This implies that Spring is instantiating your impl, and not cxf. I'm
> >>> not sure if that's the case though. This also implies that your ok
> >>> with implementing Spring interfaces :P
> >>>
> >>>
> >>> On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
> >>>> I have a POJO web service configured as a jaxws endpoint in a
> >>>> servlet container.
> >>>>
> >>>> <jaxws:endpoint id="someService"
> >>>> implementor="test.SomeServiceImpl"
> >>>> address="/SomeService" />
> >>>>
> >>>> The implementor needs to be informed when it is shutdown, how do I
> >>>> get CXF to do this?
> >>>>
> >
>
Re: POJO service lifecycle
Posted by Chris Campbell <cc...@quaris.com>.
Works! Thanks. Only thing I had to do was add a bean definition for
the implementor, then reference that bean in the implementor
attribute for the jaxws:endpoint - previously I just had the
jaxws:endpoint in the config...
so I now have
<bean id="SomeServiceImpl" class="test.SomeServiceImpl"/>
<jaxws:endpoint id="someService"
implementor="#SomeServiceImpl"
address="/SomeService" />
Where test.SomeServiceImpl implements DisposableBean
Thanks again.
Ray Krueger wrote:
> Spring is used behind the scenes for everything in CXF though. You
> should be able to implement those. Again, if you're willing to and it
> makes sense.
>
> I'm also totally guessing on this, give it a shot, see if it works :)
>
>
> On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
>> I am using the CXFServlet to load the endpoints, so the spring
>> interfaces do not work. Is there a CXF way to do this?
>>
>> Ray Krueger wrote:
>>> You can probably implement Spring's InitializingBean and
>>> DisposableBean interfaces. Those are called during the BeanFactory
>>> lifecycle.
>>> http://www.springframework.org/docs/api/org/springframework/beans/factory/InitializingBean.html
>>> http://www.springframework.org/docs/api/org/springframework/beans/factory/DisposableBean.html
>>>
>>> This implies that Spring is instantiating your impl, and not cxf. I'm
>>> not sure if that's the case though. This also implies that your ok
>>> with implementing Spring interfaces :P
>>>
>>>
>>> On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
>>>> I have a POJO web service configured as a jaxws endpoint in a
>>>> servlet container.
>>>>
>>>> <jaxws:endpoint id="someService"
>>>> implementor="test.SomeServiceImpl"
>>>> address="/SomeService" />
>>>>
>>>> The implementor needs to be informed when it is shutdown, how do I
>>>> get CXF to do this?
>>>>
>
Re: POJO service lifecycle
Posted by Ray Krueger <ra...@gmail.com>.
Spring is used behind the scenes for everything in CXF though. You
should be able to implement those. Again, if you're willing to and it
makes sense.
I'm also totally guessing on this, give it a shot, see if it works :)
On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
> I am using the CXFServlet to load the endpoints, so the spring
> interfaces do not work. Is there a CXF way to do this?
>
> Ray Krueger wrote:
> > You can probably implement Spring's InitializingBean and
> > DisposableBean interfaces. Those are called during the BeanFactory
> > lifecycle.
> > http://www.springframework.org/docs/api/org/springframework/beans/factory/InitializingBean.html
> > http://www.springframework.org/docs/api/org/springframework/beans/factory/DisposableBean.html
> >
> > This implies that Spring is instantiating your impl, and not cxf. I'm
> > not sure if that's the case though. This also implies that your ok
> > with implementing Spring interfaces :P
> >
> >
> > On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
> >> I have a POJO web service configured as a jaxws endpoint in a
> >> servlet container.
> >>
> >> <jaxws:endpoint id="someService"
> >> implementor="test.SomeServiceImpl"
> >> address="/SomeService" />
> >>
> >> The implementor needs to be informed when it is shutdown, how do I
> >> get CXF to do this?
> >>
> >
>
Re: POJO service lifecycle
Posted by Chris Campbell <cc...@quaris.com>.
I am using the CXFServlet to load the endpoints, so the spring
interfaces do not work. Is there a CXF way to do this?
Ray Krueger wrote:
> You can probably implement Spring's InitializingBean and
> DisposableBean interfaces. Those are called during the BeanFactory
> lifecycle.
> http://www.springframework.org/docs/api/org/springframework/beans/factory/InitializingBean.html
> http://www.springframework.org/docs/api/org/springframework/beans/factory/DisposableBean.html
>
> This implies that Spring is instantiating your impl, and not cxf. I'm
> not sure if that's the case though. This also implies that your ok
> with implementing Spring interfaces :P
>
>
> On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
>> I have a POJO web service configured as a jaxws endpoint in a
>> servlet container.
>>
>> <jaxws:endpoint id="someService"
>> implementor="test.SomeServiceImpl"
>> address="/SomeService" />
>>
>> The implementor needs to be informed when it is shutdown, how do I
>> get CXF to do this?
>>
>
Re: POJO service lifecycle
Posted by Ray Krueger <ra...@gmail.com>.
You can probably implement Spring's InitializingBean and
DisposableBean interfaces. Those are called during the BeanFactory
lifecycle.
http://www.springframework.org/docs/api/org/springframework/beans/factory/InitializingBean.html
http://www.springframework.org/docs/api/org/springframework/beans/factory/DisposableBean.html
This implies that Spring is instantiating your impl, and not cxf. I'm
not sure if that's the case though. This also implies that your ok
with implementing Spring interfaces :P
On 8/21/07, Chris Campbell <cc...@quaris.com> wrote:
> I have a POJO web service configured as a jaxws endpoint in a
> servlet container.
>
> <jaxws:endpoint id="someService"
> implementor="test.SomeServiceImpl"
> address="/SomeService" />
>
> The implementor needs to be informed when it is shutdown, how do I
> get CXF to do this?
>