ammulder 2005/12/10 11:52:06
Modified: modules/core/src/java/org/openejb/entity/cmp Tag: v2_0
CMPInstanceContextFactory.java
Log:
Merge deployment error fixes to branch
Revision Changes Path
No revision
No revision
1.16.8.1 +25 -15
openejb/modules/core/src/java/org/openejb/entity/cmp/CMPInstanceContextFactory.java
Index: CMPInstanceContextFactory.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/entity/cmp/CMPInstanceContextFactory.java,v
retrieving revision 1.16
retrieving revision 1.16.8.1
diff -u -r1.16 -r1.16.8.1
--- CMPInstanceContextFactory.java 25 Feb 2005 23:06:10 -0000 1.16
+++ CMPInstanceContextFactory.java 10 Dec 2005 16:52:06 -0000 1.16.8.1
@@ -47,17 +47,6 @@
*/
package org.openejb.entity.cmp;
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import javax.ejb.EntityBean;
-import javax.ejb.EntityContext;
-import javax.ejb.EJBException;
-
import net.sf.cglib.proxy.Callback;
import net.sf.cglib.proxy.CallbackFilter;
import net.sf.cglib.proxy.Enhancer;
@@ -67,6 +56,7 @@
import org.apache.geronimo.core.service.Interceptor;
import org.apache.geronimo.transaction.InstanceContext;
import org.apache.geronimo.transaction.context.TransactionContextManager;
+import org.apache.geronimo.common.DeploymentException;
import org.openejb.InstanceContextFactory;
import org.openejb.dispatch.InterfaceMethodSignature;
import org.openejb.dispatch.MethodHelper;
@@ -77,6 +67,17 @@
import org.tranql.cache.FaultHandler;
import org.tranql.identity.IdentityTransform;
+import javax.ejb.EJBException;
+import javax.ejb.EntityBean;
+import javax.ejb.EntityContext;
+import java.io.Serializable;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
/**
* @version $Revision$ $Date$
*/
@@ -98,7 +99,7 @@
private transient TransactionContextManager transactionContextManager;
private transient BasicTimerService timerService;
- public CMPInstanceContextFactory(Object containerId, CMP1Bridge
cmp1Bridge, IdentityTransform primaryKeyTransform, FaultHandler loadFault,
Class beanClass, Map imap, Set unshareableResources, Set
applicationManagedSecurityResources) {
+ public CMPInstanceContextFactory(Object containerId, CMP1Bridge
cmp1Bridge, IdentityTransform primaryKeyTransform, FaultHandler loadFault,
Class beanClass, Map imap, Set unshareableResources, Set
applicationManagedSecurityResources) throws DeploymentException {
this.containerId = containerId;
this.cmp1Bridge = cmp1Bridge;
this.primaryKeyTransform = primaryKeyTransform;
@@ -124,7 +125,11 @@
Map.Entry entry = (Map.Entry) iterator.next();
MethodSignature signature = (MethodSignature) entry.getKey();
InstanceOperation iop = (InstanceOperation) entry.getValue();
- itable[MethodHelper.getSuperIndex(enhancedClass, signature)]
= iop;
+ int index = MethodHelper.getSuperIndex(enhancedClass,
signature);
+ if(index < 0) {
+ throw new DeploymentException("Based on the EJB
configuration I expected to find a method
"+beanClass.getName()+"."+signature.toString()+" but no such method was found");
+ }
+ itable[index] = iop;
}
} else {
enhancer = null;
@@ -201,6 +206,11 @@
};
private Object readResolve() {
- return new CMPInstanceContextFactory(containerId, cmp1Bridge,
primaryKeyTransform, loadFault, beanClass, imap, unshareableResources,
applicationManagedSecurityResources);
+ try {
+ return new CMPInstanceContextFactory(containerId, cmp1Bridge,
primaryKeyTransform, loadFault, beanClass, imap, unshareableResources,
applicationManagedSecurityResources);
+ } catch (DeploymentException e) {
+ e.printStackTrace();
+ return null;
+ }
}
}