tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Louis MONTEIRO <jean-louis.monte...@atosorigin.com>
Subject Re: 3.0 Singleton in Container Question
Date Tue, 08 Sep 2009 11:59:34 GMT



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.

http://openejb.apache.org/3.0/spring.html
http://openejb.apache.org/3.0/spring-ejb-and-jpa.html


Hope it helps.
Jean-Louis
-- 
View this message in context: http://www.nabble.com/3.0-Singleton-in-Container-Question-tp25342947p25344767.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Mime
View raw message