David

I have attached path for MaangedBeanTest that shows the situation I have 
explained.

Please have a look,

https://issues.apache.org/jira/browse/OPENEJB-1361


Thanks;

--Gurkan



----- Original Message ----
From: David Blevins <[email protected]>
To: [email protected]
Sent: Wed, September 22, 2010 10:09:49 PM
Subject: Re: Managed Beans References


On Sep 22, 2010, at 10:05 AM, Gurkan Erdogdu wrote:
> Currently OpenEJB scans managed beans as normal EJBs. If a managed bean class 
> does not implement any interface, it treats as LocalBean otherwise it treats 
> as 
>
> Business Local interface. I think that one can always assumes managed beans 
> as 

> LocalBeans. It is easy to update current code for this happen:
> 
> In AnnotationDeployer # processSessionInterfaces
> 
> boolean isManagedBean = beanClass.isAnnotationPresent(ManagedBean.class);
> if(isManagedBean){
>   sessionBean.setLocalBean(new Empty()); 
> }else{
>   .....
> }
> 

Nice catch.  That's a good change.

> 
> One more thing is that Java EE 6 specification says that each lookup for 
>managed 
>
> beans must return a new instance. Currently, ManagedBeans are bound to JNDI 
>with 
>
> java:/module/BeanName and java:/app/module_name/bean_name and each lookup 
> gives 
>
> the same instance.

Not seeing that behavior.  I just augmented our test to verify one instance is 
created per lookup and it doesn't show any issues.  The test uses the 
OpenEJB-specific global JNDI name rather than java:comp or java:app, but it 
should be the same.

If there is a problem than it will affect @Stateful as well and we'd definitely 
need to fix that.

How are you verifying this behavior?

-David


Reply via email to