tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quintin Beukes <>
Subject Re: 3.0 Singleton in Container Question
Date Tue, 08 Sep 2009 13:41:33 GMT

Those links you gave me is exactly what I'm looking for, and I've
looked at them. Though they're only for OpenEJB 3.1, which is not
available in Geronimo. Further I had a look at the OpenEJB 3.0 Spring
integration, but that won't help me.

Take for instance a real world example. I want to strap all my classes
with AOP interceptors, for auditing purposes. This way I can record
what each user did, without having to add a bunch of code into each
method. I can also disable it for certain users, and easily modify
it's behaviour. Perfect example of where AOP is a life saver.

Though OpenEJB 3.0 doesn't have Spring integration.

How difficult would it be to integrate OpenEJB 3.1 into Geronimo?


On Tue, Sep 8, 2009 at 1:59 PM, Jean-Louis MONTEIRO
<> wrote:
> Q Beukes wrote:
>> Hey,
>> How does the classloaders for OpenEJB 3.0 work. I'm looking into
>> getting an application wide, or at least client login session-wide
>> Spring ApplicationContext. Just to clarify, I want to get a Spring
>> context so to be able to have certain spring benefits like AOP and
>> configurable wiring+beans+services, etc. The standard spring features.
>> To get this, either Geronimo 2.1.4 needs some Spring support to give
>> me an ApplicationContext, or OpenEJB needs some way with which I can
>> manage a singleton (ApplicationContext).
>> I was thinking of making a PropertyEditor, that translates back to a
>> wrapper for the ApplicationContext, and then I inject it with an
>> @Resource. Something like:
>> @Resource
>> private MyApplicationContext applicationContext;
>> void someMethod()
>> {
>>   applicationContext.getBean("...");
>> }
>> But for this context to work I need to make it a Singleton? The main
>> reason for this is so 2 consecutive requests to an EJB that might
>> reach a different instance, need to get the same appcontext instance
>> for a given login session, so if not possible I would rather have all
>> my EJBs reach a single wrapper instance, and then based on the current
>> security context (ie. session) distinguish between application
>> instances, that is if that security context is accessible via static
>> methods (similar to JAAS's method for accessing it).
>> Any ideas/advise? Is this even necessary? If it needs some work, I'll
>> be willing to invest the time to perhaps build a plugin for
>> OpenEJB/Geronimo, which someone can use to add basic Spring
>> integration to Geronimo 2.1 or OpenEJB 3.0.
>> --
>> Quintin Beukes
> Hello Quintin,
> did you have a look to spring sample ?
> OpenEJB have a nice (starting) Spring integration. It allows injecting
> spring beans in Java EE components and Java EE components in Spring beans.
> Hope it helps.
> Jean-Louis
> --
> View this message in context:
> Sent from the OpenEJB User mailing list archive at

Quintin Beukes

View raw message