openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r987035 - /openwebbeans/trunk/webbeans-openejb/src/main/java/org/apache/webbeans/ejb/component/OpenEjbBean.java
Date Thu, 19 Aug 2010 06:40:35 GMT
Author: gerdogdu
Date: Thu Aug 19 06:40:35 2010
New Revision: 987035

URL: http://svn.apache.org/viewvc?rev=987035&view=rev
Log:
use of OpenEJB#CoreDeploymentInfo getRemoveMethods

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=987035&r1=987034&r2=987035&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
Thu Aug 19 06:40:35 2010
@@ -22,7 +22,6 @@ import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.ejb.Remove;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.SessionBeanType;
 
@@ -121,56 +120,9 @@ public class OpenEjbBean<T> extends Base
     @Override
     public List<Method> getRemoveMethods()
     {
-        // Should we delegate to super and merge both?
-        return findRemove(deploymentInfo.getBeanClass(), deploymentInfo.getBusinessLocalInterface());
+        return this.deploymentInfo.getRemoveMethods();
     }
-    
-    /**
-     * Find all methods annotated with
-     * 
-     * @Remove into the bean implementation class and store the equivalent
-     *         method of the interface into the removes Map
-     * @param beanClass : the bean implementation class
-     * @param beanInterface : the bean interface class
-     */
-    @SuppressWarnings("unchecked")
-    private final List<Method> findRemove(Class beanClass, Class beanInterface)
-    {
-        List<Method> toReturn = new ArrayList<Method>();
         
-        // Get all the public methods of the bean class and super class
-        Method[] methods = beanClass.getMethods();
-
-        // Search for methods annotated with @Remove
-        for (Method method : methods)
-        {
-            Remove annotation = method.getAnnotation(Remove.class);
-            if (annotation != null)
-            {
-                // Get the corresponding method into the bean interface
-                Method interfaceMethod;
-                try
-                {
-                    interfaceMethod = beanInterface.getMethod(method.getName(), 
-                                                            method.getParameterTypes());
-                    
-                    toReturn.add(interfaceMethod);
-                }
-                catch (SecurityException e)
-                {
-                    e.printStackTrace();
-                }
-                catch (NoSuchMethodException e)
-                {
-                    // The method can not be into the interface in which case we
-                    // don't wonder of
-                }
-            }
-        }
-        
-        return toReturn;
-    }
-    
     @SuppressWarnings("unchecked")
     private BusinessLocalHome getBusinessLocalHome(List<Class> interfaces)
     {



Mime
View raw message