tomee-users mailing list archives

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

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:

private MyApplicationContext applicationContext;

void someMethod()

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

View raw message