openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r932844 - /openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/component/OpenEjbBean.java
Date Sun, 11 Apr 2010 07:33:52 GMT
Author: gerdogdu
Date: Sun Apr 11 07:33:51 2010
New Revision: 932844

URL: http://svn.apache.org/viewvc?rev=932844&view=rev
Log:
[OWB-348] Adding Interceptor and Decorator Support for EJB Beans

Modified:
    openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/component/OpenEjbBean.java

Modified: openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/component/OpenEjbBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/component/OpenEjbBean.java?rev=932844&r1=932843&r2=932844&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/component/OpenEjbBean.java
(original)
+++ openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/component/OpenEjbBean.java
Sun Apr 11 07:33:51 2010
@@ -75,34 +75,33 @@ public class OpenEjbBean<T> extends Base
     @SuppressWarnings("unchecked")
     protected T getInstance(CreationalContext<T> creationalContext)
     {
-        if(this.instance == null)
+        T instance = null;
+        
+        ContainerSystem containerSystem =  SystemInstance.get().getComponent(ContainerSystem.class);
+        Context jndiContext = containerSystem.getJNDIContext();
+        DeploymentInfo deploymentInfo = this.getDeploymentInfo();
+        try
         {
-            ContainerSystem containerSystem =  SystemInstance.get().getComponent(ContainerSystem.class);
-            Context jndiContext = containerSystem.getJNDIContext();
-            DeploymentInfo deploymentInfo = this.getDeploymentInfo();
-            try
+            if(iface != null)
             {
-                if(iface != null)
-                {
-                    InterfaceType type = deploymentInfo.getInterfaceType(iface);
-                    if(!type.equals(InterfaceType.BUSINESS_LOCAL))
-                    {
-                        throw new IllegalArgumentException("Interface type is not legal business
local interface for session bean class : " + getReturnType().getName());
-                    }   
-                }    
-                else
+                InterfaceType type = deploymentInfo.getInterfaceType(iface);
+                if(!type.equals(InterfaceType.BUSINESS_LOCAL))
                 {
-                    iface = this.deploymentInfo.getBusinessLocalInterface();
-                }
-                
-                String jndiName = "java:openejb/Deployment/" + JndiBuilder.format(deploymentInfo.getDeploymentID(),
this.iface.getName()); 
-                this.instance = (T)this.iface.cast(jndiContext.lookup(jndiName));       
                     
-                
-            }catch(NamingException e)
+                    throw new IllegalArgumentException("Interface type is not legal business
local interface for session bean class : " + getReturnType().getName());
+                }   
+            }    
+            else
             {
-                throw new RuntimeException(e);
-            }        
-        }
+                iface = this.deploymentInfo.getBusinessLocalInterface();
+            }
+            
+            String jndiName = "java:openejb/Deployment/" + JndiBuilder.format(deploymentInfo.getDeploymentID(),
this.iface.getName()); 
+            instance = (T)this.iface.cast(jndiContext.lookup(jndiName));                
            
+            
+        }catch(NamingException e)
+        {
+            throw new RuntimeException(e);
+        }        
 
         return instance;
     }



Mime
View raw message