@Override public Object processInvocation(InterceptorContext context) throws Exception { final ComponentInstance componentInstance = context.getPrivateData(ComponentInstance.class); ManagedReference entityManagerRef = (ManagedReference) componentInstance.getInstanceData(SFSBInvocationInterceptor.CONTEXT_KEY); if(entityManagerRef != null) { Map<String, ExtendedEntityManager> entityManagers = (Map<String, ExtendedEntityManager>) entityManagerRef.getInstance(); SFSBCallStack.pushCall(entityManagers); } try { return context.proceed(); // call the next interceptor or target } finally { if(entityManagerRef != null) { SFSBCallStack.popCall(); } } } }
@Override public Object processInvocation(InterceptorContext context) throws Exception { final ComponentInstance componentInstance = context.getPrivateData(ComponentInstance.class); ManagedReference entityManagerRef = (ManagedReference) componentInstance.getInstanceData(SFSBInvocationInterceptor.CONTEXT_KEY); if(entityManagerRef != null) { Map<String, ExtendedEntityManager> entityManagers = (Map<String, ExtendedEntityManager>) entityManagerRef.getInstance(); SFSBCallStack.pushCall(entityManagers); } try { return context.proceed(); // call the next interceptor or target } finally { if(entityManagerRef != null) { SFSBCallStack.popCall(); } } } }