dblevins 2005/06/21 17:16:57
Modified: modules/core/src/java/org/openejb/entity/bmp
BMPCreateMethod.java BMPFinderMethod.java
Log:
Removing 47 references to the SimpleInvocationResult constructor and
replacing with a factory method on EJBInvocatin interface. The
implementor of EJBInvocation should be able to decide the
implementation of InvocationResult.
Revision Changes Path
1.5 +4 -4
openejb/modules/core/src/java/org/openejb/entity/bmp/BMPCreateMethod.java
Index: BMPCreateMethod.java
===================================================================
RCS file:
/scm/openejb/openejb/modules/core/src/java/org/openejb/entity/bmp/BMPCreateMethod.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- BMPCreateMethod.java 25 Feb 2005 23:06:09 -0000 1.4
+++ BMPCreateMethod.java 21 Jun 2005 21:16:57 -0000 1.5
@@ -120,7 +120,7 @@
Throwable t = ite.getTargetException();
if (t instanceof Exception && t instanceof RuntimeException ==
false) {
// checked exception - which we simply include in the result
- return new SimpleInvocationResult(false, t);
+ return invocation.createExceptionResult((Exception)t);
} else {
// unchecked Exception - just throw it to indicate an
abnormal completion
throw t;
@@ -146,7 +146,7 @@
Throwable t = ite.getTargetException();
if (t instanceof Exception && t instanceof RuntimeException ==
false) {
// checked exception - which we simply include in the result
- return new SimpleInvocationResult(false, t);
+ return invocation.createExceptionResult((Exception)t);
} else {
// unchecked Exception - just throw it to indicate an
abnormal completion
throw t;
@@ -158,7 +158,7 @@
EJBInterfaceType type = invocation.getType();
- return new SimpleInvocationResult(true, getReference(type.isLocal(),
ctx.getProxyFactory(), id));
+ return invocation.createResult(getReference(type.isLocal(),
ctx.getProxyFactory(), id));
}
private Object getReference(boolean local, EJBProxyFactory proxyFactory,
Object id) {
1.4 +5 -5
openejb/modules/core/src/java/org/openejb/entity/bmp/BMPFinderMethod.java
Index: BMPFinderMethod.java
===================================================================
RCS file:
/scm/openejb/openejb/modules/core/src/java/org/openejb/entity/bmp/BMPFinderMethod.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BMPFinderMethod.java 14 Feb 2005 18:32:29 -0000 1.3
+++ BMPFinderMethod.java 21 Jun 2005 21:16:57 -0000 1.4
@@ -109,7 +109,7 @@
Throwable t = ite.getTargetException();
if (t instanceof Exception && t instanceof RuntimeException ==
false) {
// checked exception - which we simply include in the result
- return new SimpleInvocationResult(false, t);
+ return invocation.createExceptionResult((Exception)t);
} else {
// unchecked Exception - just throw it to indicate an
abnormal completion
throw t;
@@ -128,16 +128,16 @@
while (e.hasMoreElements()) {
values.add(getReference(local, proxyFactory,
e.nextElement()));
}
- return new SimpleInvocationResult(true, new
SerializableEnumeration(values.toArray()));
+ return invocation.createResult(new
SerializableEnumeration(values.toArray()));
} else if (finderResult instanceof Collection) {
Collection c = (Collection) finderResult;
ArrayList result = new ArrayList(c.size());
for (Iterator i = c.iterator(); i.hasNext();) {
result.add(getReference(local, proxyFactory, i.next()));
}
- return new SimpleInvocationResult(true, result);
+ return invocation.createResult(result);
} else {
- return new SimpleInvocationResult(true, getReference(local,
proxyFactory, finderResult));
+ return invocation.createResult(getReference(local, proxyFactory,
finderResult));
}
}