Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.apache.openejb.ApplicationException;
import org.apache.openejb.BeanContext;
import org.apache.openejb.ContainerType;
import org.apache.openejb.InterfaceType;
import org.apache.openejb.InvalidateReferenceException;
import org.apache.openejb.OpenEJBException;
Expand All @@ -35,6 +36,7 @@
import javax.ejb.EJBAccessException;
import javax.ejb.EJBLocalObject;
import javax.ejb.EJBObject;
import javax.ejb.Remove;
import java.io.ObjectStreamException;
import java.lang.reflect.Method;
import java.rmi.AccessException;
Expand Down Expand Up @@ -75,7 +77,7 @@ public Object _invoke(final Object p, final Class interfce, final Method m, fina
if (logger.isDebugEnabled()) {
logger.debug("EjbObjectProxyHandler: invoking method " + methodName + " on " + deploymentID + " with identity " + primaryKey);
}
Integer operation = dispatchTable.get(methodName);
Integer operation = getMappedOperation(m);
if (operation != null) {
if (operation == 3) {
if (m.getParameterTypes()[0] != EJBObject.class && m.getParameterTypes()[0] != EJBLocalObject.class) {
Expand All @@ -85,7 +87,12 @@ public Object _invoke(final Object p, final Class interfce, final Method m, fina
operation = m.getParameterTypes().length == 0 ? operation : null;
}
}
if (operation == null || !interfaceType.isComponent()) {


boolean isComponentOperation = operation != null && interfaceType.isComponent();
boolean isRemoveOperation = dispatchTable.get("remove").equals(operation) && ContainerType.STATEFUL.equals(this.container.getContainerType());

if (!isComponentOperation && !isRemoveOperation) {
retValue = businessMethod(interfce, m, a, p);
} else {
switch (operation) {
Expand Down Expand Up @@ -174,6 +181,14 @@ public Object _invoke(final Object p, final Class interfce, final Method m, fina
}
}

private static Integer getMappedOperation(final Method m) {
Integer opCode = dispatchTable.get(m.getName());
if (opCode == null && m.getDeclaredAnnotation(Remove.class) != null) {
opCode = dispatchTable.get("remove");
}
return opCode;
}

protected Object getEJBHome(final Method method, final Object[] args, final Object proxy) throws Throwable {
checkAuthorization(method);
return getBeanContext().getEJBHome();
Expand Down
Loading