cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Persistent helper objects on server side
Date Wed, 01 Oct 2008 17:09:59 GMT
On Wednesday 01 October 2008, Andrew Clegg wrote:
> Thanks, I'll look into the bus option. I guess the advantage of this
> over Glen's static initializer is that you could share objects on the
> bus between different services?

Yep.   The Bus has add/get extension things that you can use to 
store/retrieve objects.   All users of that bus can share those things.

Dan


> Bit reluctant to go for a Spring solution as there's only one coder on
> this project -- me -- with a total of 0 days Spring experience.
>
> Cheers,
>
> Andrew.
>
> On 1 Oct 2008, at 17:53, Daniel Kulp <dkulp@apache.org> wrote:
> > I guess the "proper" answer for us at this point would be to define
> > the
> > objects in Spring and let spring inject them into your service beans
> > and
> > stuff.   That's more or less the normal way we do it.
> >
> > Another option it to inject the Bus into your service with:
> > @Resource
> > Bus bus;
> >
> > And save things on the bus that you could retrieve later.
> >
> > Dan
> >
> > On Wednesday 01 October 2008, 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.)
> >
> > --
> > J. Daniel Kulp
> > Principal Engineer, IONA
> > dkulp@apache.org
> > http://www.dankulp.com/blog



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Mime
View raw message