Skip to content

Commit

Permalink
WELD-1211 CDI-207 fire @initialized(RequestScoped.class) and @DESTROYED
Browse files Browse the repository at this point in the history
…(RequestScoped.class) for EJB calls
  • Loading branch information
jharting committed Sep 27, 2012
1 parent cea8b76 commit 73f8b75
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import org.jboss.msc.service.ServiceName;
import org.jboss.weld.context.ejb.EjbLiteral;
import org.jboss.weld.context.ejb.EjbRequestContext;
import org.jboss.weld.literal.DestroyedLiteral;
import org.jboss.weld.literal.InitializedLiteral;
import org.jboss.weld.manager.BeanManagerImpl;

/**
Expand Down Expand Up @@ -91,11 +93,13 @@ public Object processInvocation(final InterceptorContext context) throws Excepti
try {
requestContext.associate(context.getInvocationContext());
requestContext.activate();
beanManager.getGlobalLenientObserverNotifier().fireEvent(new Object(), InitializedLiteral.REQUEST);
return context.proceed();
} finally {
requestContext.invalidate();
requestContext.deactivate();
requestContext.dissociate(context.getInvocationContext());
beanManager.getGlobalLenientObserverNotifier().fireEvent(new Object(), DestroyedLiteral.REQUEST);
}
}

Expand Down

0 comments on commit 73f8b75

Please sign in to comment.