notifySession = (ctx.getInstance() instanceof javax.ejb.SessionSynchronization);
public void afterBegin() { if (notifySession) { try { AllowedOperationsAssociation.pushInMethodFlag(IN_AFTER_BEGIN); afterBegin.invoke(ctx.getInstance(), new Object[0]); } catch (Exception e) { log.error("failed to invoke afterBegin", e); } finally{ AllowedOperationsAssociation.popInMethodFlag(); } } }
public void beforeCompletion() { if( log.isTraceEnabled() ) log.trace("beforeCompletion called"); // lock the context the transaction is being commited (no need for sync) ctx.lock(); beforeCompletionInvoked = true; if (notifySession) { try { AllowedOperationsAssociation.pushInMethodFlag(IN_BEFORE_COMPLETION); container.pushENC(); beforeCompletion.invoke(ctx.getInstance(), new Object[0]); } catch (Exception e) { log.error("failed to invoke beforeCompletion", e); } finally { container.popENC(); AllowedOperationsAssociation.popInMethodFlag(); } } }
if (status == Status.STATUS_COMMITTED) afterCompletion.invoke(ctx.getInstance(), new Object[]{Boolean.TRUE}); afterCompletion.invoke(ctx.getInstance(), new Object[]{Boolean.FALSE});
Boolean modified = (Boolean) isModified.invoke (ctx.getInstance (), new Object[0]); if (modified.booleanValue ()) synchronizeState (ctx);
Object bean = ctx.getInstance(); return mi.performCall(bean, m, mi.getArguments());
public Object invoke(Invocation mi) throws Exception { Object key = ((EnterpriseContext) mi.getEnterpriseContext()).getInstance(); try { ccm.pushMetaAwareObject(key, unsharableResources); try { return getNext().invoke(mi); } finally { ccm.popMetaAwareObject(unsharableResources); } } catch (ResourceException e) { InvocationType type = mi.getType(); boolean isLocal = (type == InvocationType.LOCAL || type == InvocationType.LOCALHOME); if (isLocal) throw new EJBException("Resource problem during invoke", e); else throw new RemoteException("Resource problem during invoke", e); } }
Object instance = ctx.getInstance();
return mi.performCall(ctx.getInstance(), m, mi.getArguments());
Object bean = ctx.getInstance(); return mi.performCall(bean, m, mi.getArguments());
public Object invoke(Invocation mi) throws Exception { // Apply any custom security checks if( securityProxy != null ) { EnterpriseContext ectx = (EnterpriseContext)mi.getEnterpriseContext(); Object bean = ectx.getInstance(); EJBContext ctx = ectx.getEJBContext(); Object[] args = mi.getArguments(); securityProxy.setEJBContext(ctx); try { securityProxy.invoke(mi.getMethod(), args, bean); } catch(SecurityException e) { Principal principal = mi.getPrincipal(); String msg = "SecurityProxy.invoke exception, principal="+principal; log.error(msg, e); throw e; } } return getNext().invoke(mi); } }
else Object key = ctx.getInstance(); try
return mi.performCall(ctx.getInstance(), m, mi.getArguments());
EnterpriseBeanPolicyContextHandler.setEnterpriseBean(ctx.getInstance());
EnterpriseBeanPolicyContextHandler.setEnterpriseBean(ctx.getInstance());