this.ctx = ctx;
}
public void beforeCompletion()
{
final SessionSynchronization sync = ctx.getSessionSynchronization();
// The bean might be lost in action if an exception is thrown in afterBegin
if(ctx.getInstance() == null)
return;
pushEnc();
try
{
// FIXME: This is a dirty hack to notify AS EJBTimerService about what's going on
AllowedOperationsAssociation.pushInMethodFlag(AllowedOperationsAssociation.IN_BEFORE_COMPLETION);
// TODO: use interceptors to setup a context
SessionInvocationContext invocation = new BaseSessionInvocationContext(null, null, null) {
@Override
public Object proceed() throws Exception
{
sync.beforeCompletion();
return null;
}
};
invocation.setEJBContext(ctx.getEJBContext());
CurrentInvocationContext.push(invocation);