This content has been marked as final.
Show 8 replies
-
1. Re: A callback on EJB removal
alrubinger Mar 8, 2009 2:09 PM (in response to pmuir)Just for SFSB I'd imagine?
Our standard M.O. applies I guess; make some SPI to register a callback listener in wb-as-int and we'll invoke upon it via some EJB3 optional add-on component.
What contextual information do you need? Session ID?
S,
ALR -
2. Re: A callback on EJB removal
pmuir Mar 8, 2009 2:36 PM (in response to pmuir)"ALRubinger" wrote:
Just for SFSB I'd imagine?
Oops, yes :-)Our standard M.O. applies I guess; make some SPI to register a callback listener in wb-as-int and we'll invoke upon it via some EJB3 optional add-on component.
What contextual information do you need? Session ID?
What is the best way (that ideally is standard, otherwise we'll need another SPI for identifying an SFSB) to identify an SFSB instance?
I was struggling with this, as the object instance we obtained from JNDI isn't useful. I guess we could use the object instance obtained from invocationContext.getTarget()... -
3. Re: A callback on EJB removal
pmuir Mar 8, 2009 2:38 PM (in response to pmuir)N.B. This is effectively the inverse of http://www.jboss.org/index.html?module=bb&op=viewtopic&t=151896, where, rather than wanting to be notified that an EJB was removed by someone other than Web Beans, we want to request an EJB be removed.
-
4. Re: A callback on EJB removal
alrubinger Mar 8, 2009 6:33 PM (in response to pmuir)"pete.muir@jboss.org" wrote:
What is the best way (that ideally is standard, otherwise we'll need another SPI for identifying an SFSB) to identify an SFSB instance?
You mean the ID of a given proxy? ATM we'd be diving into implementation details by getting the it out of a field in the InvocationHandler.
http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/handler/session/stateful/StatefulProxyInvocationHandlerBase.java
You can't rely upon that now by doing Proxy.getInvocationHandler(proxy) because that's digging too deep into internals.
We could expose this by adding interface support for a JBossStatefulSessionObject in the proxy, which has some method getId():JBossStatefulSessionObject proxy = (JBossStatefulSessionObject)jndiContext.lookup("address"); Serializable id = proxy.getId();
WDYT?
S,
ALR -
5. Re: A callback on EJB removal
wolfc Mar 9, 2009 3:18 AM (in response to pmuir)Why doesn't the @PreDestroy on the SeamInterceptor work?
-
6. Re: A callback on EJB removal
alrubinger Mar 9, 2009 11:05 AM (in response to pmuir)"ALRubinger" wrote:
We could expose this by adding interface support for a JBossStatefulSessionObject in the proxy, which has some method getId();
I did this in r85648 for https://jira.jboss.org/jira/browse/EJBTHREE-1758.StatefulSessionProxy statefulProxy = (StatefulSessionProxy)proxy; Serializable sessionId = statefulProxy.getSessionId();
S,
ALR -
7. Re: A callback on EJB removal
pmuir Mar 9, 2009 11:20 AM (in response to pmuir)"wolfc" wrote:
Why doesn't the @PreDestroy on the SeamInterceptor work?
It probably does, I hadn't thought of this. I'll check it out. -
8. Re: A callback on EJB removal
pmuir Mar 14, 2009 12:38 PM (in response to pmuir)This works well - thanks Carlo for pointing out the obvious :-)