You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Autumn Wang <au...@hotmail.com> on 2008/06/16 22:46:08 UTC

Any initialization method in CXF?

I am new to both web services and CXF and I don't know how to get the
following done with CXF. 

I am going to dispatch a thread to poll a database before my web service to
serve the client. So I would like to know how to do some initialization work
for one web service class? I would also like to know how to do the
initialization work for all the web services classes? Has there any init
method I could implement and plug in to CXF?

Any ideas?

I appreciate your help.

Autumn 
-- 
View this message in context: http://www.nabble.com/Any-initialization-method-in-CXF--tp17872951p17872951.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Any initialization method in CXF?

Posted by Daniel Kulp <dk...@apache.org>.
On your service bean, you can annotate a method with a @PostContruct  
annotation:


@PostConstruct
public void init() {
    //do my init stuff
}

That said, if you are using a spring config file, you can write any  
bean you want and configure it into the spring context with a  
lazyInit=false flag to force spring to load it immediately.

Dan




On Jun 16, 2008, at 4:46 PM, Autumn Wang wrote:

>
> I am new to both web services and CXF and I don't know how to get the
> following done with CXF.
>
> I am going to dispatch a thread to poll a database before my web  
> service to
> serve the client. So I would like to know how to do some  
> initialization work
> for one web service class? I would also like to know how to do the
> initialization work for all the web services classes? Has there any  
> init
> method I could implement and plug in to CXF?
>
> Any ideas?
>
> I appreciate your help.
>
> Autumn
> -- 
> View this message in context: http://www.nabble.com/Any-initialization-method-in-CXF--tp17872951p17872951.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

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





Re: Any initialization method in CXF?

Posted by Glen Mazza <gl...@verizon.net>.
http://www.jroller.com/gmazza/date/20080308?

2008-06-16 Autumn Wang wrote:
> I am new to both web services and CXF and I don't know how to get the
> following done with CXF. 
> 
> I am going to dispatch a thread to poll a database before my web service to
> serve the client. So I would like to know how to do some initialization work
> for one web service class? I would also like to know how to do the
> initialization work for all the web services classes? Has there any init
> method I could implement and plug in to CXF?
> 
> Any ideas?
> 
> I appreciate your help.
> 
> Autumn