private boolean afterMessageDeliveryInternal(ResourceHandle resourceHandle) {
// return value. assume failure until proven otherwise.
boolean success = false;
EjbInvocation invocation = null;
invocation = (EjbInvocation) invocationManager.getCurrentInvocation();
if (invocation == null) {
_logger.log(Level.SEVERE, "containers.mdb.no_invocation",
new Object[] { appEJBName_, "" });
} else {
try {
if (invocation.isContainerStartsTx()) {
// Unregister the session associated with
// the message-driven bean's destination.
unregisterMessageBeanResource(resourceHandle);
}
// counterpart of invocationManager.preInvoke
invocationManager.postInvoke(invocation);
// Commit/Rollback container-managed transaction.
postInvokeTx(invocation);
// Consider successful delivery. Commit failure will be
// checked below.
success = true;
// TODO: Check if Tx existed / committed
ejbProbeNotifier.messageDeliveredEvent(getContainerId(),
containerInfo.appName, containerInfo.modName,
containerInfo.ejbName);
} catch (Throwable ce) {
_logger.log(Level.SEVERE,
"containers.mdb.postinvoke_exception", new Object[] {
appEJBName_, ce.toString() });
_logger.log(Level.SEVERE, ce.getClass().getName(), ce);
} finally {
releaseContext(invocation);
}
// Reset original class loader
Utility.setContextClassLoader(
invocation.getOriginalContextClassLoader());
if (invocation.exception != null) {
if (isSystemUncheckedException(invocation.exception)) {
success = false;