[jboss-user] [EJB 3.0] - Re: Requesting the EJB container to remove an instance
I would prefer to wait until there is a release, so that we can update the EJB3 impl in JBoss to the correct version using the plugin updater. Thanks :-) View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218088#4218088 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218088 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Requesting the EJB container to remove an instance
"ALRubinger" wrote : https://jira.jboss.org/jira/browse/EJBTHREE-1773 Done. Relevant unit test showing usage is: http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/core/test/ejbthree1773/unit/RemoveRequestFromSessionProxyUnitTestCase.java "ALRubinger" wrote : I'll implement "remove()" for us. It's in a patch attached to WBINT-7. I didn't commit it due to the SNAPSHOT dependency upon org.jboss.ejb3:jboss-ejb3-proxy-spi (Don't know if you guys permit SNAPs). S, ALR View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218069#4218069 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218069 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Requesting the EJB container to remove an instance
"ALRubinger" wrote : I'll implement "remove()" for us. It'll be dependent upon the new EJB3 release (due out this week). I thought so. We're starting to have other deps on newer revs of JBoss AS (bug in Javassist proxies) so we'll bounce our minimum up to JBoss AS 5.1.0.CR1 once it's out. anonymous wrote : Your implementation of JBossEjbReference will not work w/ SessionContext.getInvokedBusinessInterface() because it's looking up a non-deterministic proxy. Why did you chooe to go for: | | this.jndiName = fullJndiName.substring(0, fullJndiName.lastIndexOf("-")); | | ..? | | "create" and "get" look good. | | Because I'm lazy and wanted to get something roughly working ;-) I would much prefer to use the deterministic proxy, but couldn't work out the best way to do it - if I created a new jboss.ejb3 EjbReference, I got a different SFSB instance each time. Really, we need behaviour analagous to SessionContext.getBussinessInterface() here... Any suggestions? View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218053#4218053 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218053 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Requesting the EJB container to remove an instance
On the EJB3 side: https://jira.jboss.org/jira/browse/EJBTHREE-1773 S, ALR View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218048#4218048 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218048 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Requesting the EJB container to remove an instance
I'll implement "remove()" for us. It'll be dependent upon the new EJB3 release (due out this week). Your implementation of JBossEjbReference will not work w/ SessionContext.getInvokedBusinessInterface() because it's looking up a non-deterministic proxy. Why did you chooe to go for: this.jndiName = fullJndiName.substring(0, fullJndiName.lastIndexOf("-")); ..? "create" and "get" look good. S. ALR View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218047#4218047 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218047 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Requesting the EJB container to remove an instance
BTW https://jira.jboss.org/jira/browse/WBINT-7 View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218034#4218034 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218034 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Requesting the EJB container to remove an instance
I added http://anonsvn.jboss.org/repos/webbeans/ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/api/EjbReference.java which also adds the create() method for instantiating the EJB. This also includes Ken's recomendation of using the reference to obtain the correct proxy which implements the business interface. I also wrote a naive implementation for JBoss http://anonsvn.jboss.org/repos/jbossas/projects/webbeans-ri-int/trunk/ejb/src/main/java/org/jboss/webbeans/integration/ejb/JBossEjbReference.java which uses the global local proxy that JBoss EJB3 binds, and holds a reference to the proxy locally to ensure the state is maintained over the lifecycle of the contextual instance. I would appreciate help with both the remove() method (sounds like we need a new release of JBoss EJB3 for this?) and also ideas on how to better implement the create() and get(). View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218033#4218033 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4218033 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Requesting the EJB container to remove an instance
I recommended adding onto SessionProxy: http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/proxy-spi/src/main/java/org/jboss/ejb3/proxy/spi/intf/SessionProxy.java ...to add a "removeTarget()" method. Usage becomes: Object proxy = jndiContext.lookup("MyBean/remote"); | SessionProxy sProxy = (SessionProxy)proxy; | sProxy.removeTarget(); ...which would be No-op for SLSB/Singleton and remove the underlying bean context and session ID from the cache for SFSB. S, ALR View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217865#4217865 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217865 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Requesting the EJB container to remove an instance
I talked to ALR about this a bit, here is a precis: "Andrew Rubinger" wrote : So maybe you can explain a couple things then I'll weigh in? "This needs to be in a portable way" The standard WB requirement - that WB must operate on other AS than JBoss - we can't have JBoss code in WB itself - if we do need to make a AS specific call we have to do it through the SPI "Andrew Rubinger" wrote : And you want to invoke upon what object? The proxy from JNDI? The problem is not that i need to invoke on an EJB but request the EJB container remove it. Then, we talked about the background: We need to remove ejbs (e.g. when the coversation context is destroyed), if there is a Session bean proxied instance stored in a context, it get's cleaned up automatically. "Andrew Rubinger" wrote : And you can't call @Remove ? We can't call @Remove as there might be multiple @Remove methods (which one to we call?) or there might be parameters to the remove method (how do we know what they are) "Andrew Rubinger" wrote : So you want to remove the backing session, and have no callback upon the SFSB. Which is possible but feels like a real back-door approach... The @PreDestroy callback should still be executed. In other words, if we did this through bytecode instr, it would be like adding in a @Remove public void wbRemove() {} method Then, I described a possible SPI Web Beans could use: interface EJBInstance implements Serializable { | |public void remove(); |T getInstance(); | | } and an addition to the EJBResolver Web Beans SPI: interface EJBResolver { | | // ... | | EJBInstance resolve(String jndiName); | } Where Web Beans would use it like: // initial lookup | EJBInstance ejb = ejbResolver.lookup(jndiName); | // Some requests go by, JSR299 context needs destroying | // destroy | ejb.remove(); for example, in JBoss we could implement this like: class JBossEjbInstance implements EjbInstance { | |Object proxy; |String jndiName; | |JBossEjbInstance(String jndiName) { | this.jndiName = jndiName; |} | |private init() { | if (proxy == null) { | proxy = getInitialContext().lookup(jndiName); | if (!(proxy instanceof Serializable)) | throw new IllegalStateException(); | } |} | |public T getInstance() { | init(); | return (T) instance; |} | |public void remove() { | ((StatefulSessionProxy) instance).remove(); |} | } "Andrew Rubinger" wrote : Why Serializable? Because the proxy needs e.g. to be serialzied to http session View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217807#4217807 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217807 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Requesting the EJB container to remove an instance
Hmm, this won't work, as I need this to be serializable. So, I guess we need some serializable identifier for a session bean instance. Perhaps we change to an EjbResolver for getting instances of SFSB that can return something like: interface EJBInstance { | |Serializable getId(); |T getInstance(); | | } rather than a JNDI lookup. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217676#4217676 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217676 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Requesting the EJB container to remove an instance
I guess again it comes down to needing a way to uniquely identify an SFSB instance. I guess I can squirrel away the reference to the actual bean obtained from @PostConstruct and pass that through? Would that be good way to identify it from the EJB3.0 View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4216255#4216255 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4216255 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Requesting the EJB container to remove an instance
We could bind a 'home' interface and call it 'meta' instead. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4216088#4216088 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4216088 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user