Author: genspring
Date: Sat Jun 11 02:18:30 2011
New Revision: 1134506
URL: http://svn.apache.org/viewvc?rev=1134506&view=rev
Log:
OPENEJB-1575 ejb31 spec 13.3.7.2.1 If there are multiple methods with the same
overloaded name, this style 2 refers to all the methods with the same name.
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java?rev=1134506&r1=1134505&r2=1134506&view=diff
==============================================================================
---
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java
(original)
+++
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/EnterpriseBeanBuilder.java
Sat Jun 11 02:18:30 2011
@@ -191,9 +191,26 @@ class EnterpriseBeanBuilder {
}
for (RemoveMethodInfo removeMethod :
statefulBeanInfo.removeMethods) {
- Method method = MethodInfoUtil.toMethod(ejbClass,
removeMethod.beanMethod);
- deployment.getRemoveMethods().add(method);
- deployment.setRetainIfExeption(method,
removeMethod.retainIfException);
+
+ if (removeMethod.beanMethod.methodParams == null) {
+
+ MethodInfo methodInfo = new MethodInfo();
+ methodInfo.methodName = removeMethod.beanMethod.methodName;
+ methodInfo.methodParams =
removeMethod.beanMethod.methodParams;
+ methodInfo.className = removeMethod.beanMethod.className;
+ List<Method> methods =
MethodInfoUtil.matchingMethods(methodInfo, ejbClass);
+
+ for (Method method : methods) {
+ deployment.getRemoveMethods().add(method);
+ deployment.setRetainIfExeption(method,
removeMethod.retainIfException);
+ }
+
+ } else {
+ Method method = MethodInfoUtil.toMethod(ejbClass,
removeMethod.beanMethod);
+ deployment.getRemoveMethods().add(method);
+ deployment.setRetainIfExeption(method,
removeMethod.retainIfException);
+ }
+
}
String moduleId = moduleContext.getId();
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java?rev=1134506&r1=1134505&r2=1134506&view=diff
==============================================================================
---
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java
(original)
+++
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodInfoUtil.java
Sat Jun 11 02:18:30 2011
@@ -547,13 +547,13 @@ public class MethodInfoUtil {
}
public static View view(MethodInfo methodInfo) {
- if (!methodInfo.className.equals("*")) return View.CLASS;
+ if (methodInfo.className != null && !methodInfo.className.equals("*"))
return View.CLASS;
if (methodInfo.methodIntf != null &&
!methodInfo.methodIntf.equals("*")) return View.INTERFACE;
else return View.ANY;
}
public static Level level(MethodInfo methodInfo) {
- if (methodInfo.ejbName.equals("*")) return Level.PACKAGE;
+ if (methodInfo.ejbName != null && methodInfo.ejbName.equals("*"))
return Level.PACKAGE;
if (methodInfo.methodName.equals("*")) return Level.BEAN;
if (methodInfo.methodParams == null) return Level.OVERLOADED_METHOD;
return Level.EXACT_METHOD;
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java?rev=1134506&r1=1134505&r2=1134506&view=diff
==============================================================================
---
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java
(original)
+++
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java
Sat Jun 11 02:18:30 2011
@@ -128,7 +128,7 @@ public class StatefulContainer implement
for (Class businessLocal :
beanContext.getBusinessLocalInterfaces()) {
try {
- Method method =
businessLocal.getMethod(removeMethod.getName());
+ Method method =
businessLocal.getMethod(removeMethod.getName(),
removeMethod.getParameterTypes());
methods.put(method, MethodType.REMOVE);
} catch (NoSuchMethodException thatsFine) {
}
@@ -136,7 +136,7 @@ public class StatefulContainer implement
for (Class businessRemote :
beanContext.getBusinessRemoteInterfaces()) {
try {
- Method method =
businessRemote.getMethod(removeMethod.getName());
+ Method method =
businessRemote.getMethod(removeMethod.getName(),
removeMethod.getParameterTypes());
methods.put(method, MethodType.REMOVE);
} catch (NoSuchMethodException thatsFine) {
}