For a rather primitive example, you can use a static { } block in your
service implementation bean as shown here[1] in Step #6. It's a start at
least. But note that other portions of the below blog entry (not covering
the static {} ) have since been heavily updated, with the new link at the
top of [1].
HTH,
Glen
[1] http://www.jroller.com/gmazza/date/20071019
Andrew Clegg wrote:
>
> Morning all,
>
> This is a slightly noob-ish question that reflects my lack of
> experience with Java web apps in general.
>
> I have some objects for database access and business logic which I
> want to create on deploying my service WAR. I want these to hang
> around within the CXF servlet so they can by called on by my service
> implementation classes.
>
> Where do I put the code to initialize them? And how do I call them
> from my services?
>
> A pointer to a relevant example would be ideal, unless it's just a
> two-line answer.
>
> Thanks in advance,
>
> Andrew.
>
> (PS... The objects in question use Guice for dependency injection, if
> anyone has any extra tips about linking CXF to Guice then fire away,
> otherwise I'm sure I can figure that part out from a general example.)
>
--
View this message in context:
http://www.nabble.com/Persistent-helper-objects-on-server-side-tp19758230p19759680.html
Sent from the cxf-user mailing list archive at Nabble.com.