use of javax.ejb.RemoveException in project tomee by apache.
the class CmpContainer method ejbRemove.
private void ejbRemove(final EntityBean entityBean) throws RemoveException {
if (entityBean == null) {
throw new NullPointerException("entityBean is null");
}
if (isDeleted(entityBean)) {
return;
}
final ThreadContext callContext = createThreadContext(entityBean);
callContext.setCurrentOperation(Operation.REMOVE);
final ThreadContext oldCallContext = ThreadContext.enter(callContext);
try {
entityBean.ejbRemove();
} catch (final RemoteException e) {
throw new EJBException(e);
} finally {
// todo replace with interface call when CmpEntityBean interface is added
try {
entityBean.getClass().getMethod("OpenEJB_deleted").invoke(entityBean);
} catch (final Exception ignored) {
// no-op
}
cancelTimers(callContext);
ThreadContext.exit(oldCallContext);
}
}
Aggregations