[jboss-dev-forums] [Design of EJB 3.0] - Re: Unit Tests for Unbinding References from JNDI in EJB3 Pr

ALRubinger do-not-reply at jboss.com
Wed Jun 18 14:14:07 EDT 2008


"jaikiran" wrote : I do see the test cases and the logs which show that each bean binds to the default business JNDI name and also a interface-specific JNDI name. But what exactly is the difference between the default and the interface specific bindings? 

This was put in place to support SessionContext.getInvokedBusinessInterface();.

The default business (remote|local) binding supports all business (remote|local) interfaces declared by the bean.  This is the legacy behaviour, and from this "getInvokedBusinessInterface" is non-deterministic; the Proxy can be cast to any of the Business interfaces at compile-time, but the runtime has no way of knowing which business interface was invoked.

So we introduced the notion of a an "interface-specific" binding, which has the necessary information within the Proxy itself to allow the Container to know which business interface was invoked.

Check out the (lengthy) method in JndiSessionRegistrarBase.bindEjb for details in the comments.

"jaikiran" wrote : One more question - Once the bean is unbound from the JNDI registry using:
  | 
  | Ejb3RegistrarLocator.locateRegistrar().unbind(statelessSessionContainer.getName());
  | 
  | Is the JBossMetaData present in the statelessSessionContainer (which  got unbound) expected to still maintain the jndi names? Ex: Is the metadata.determineJndiName() expected to return the jndi name after the bean was unbound? Or is it expected to return null?

Yep, it's just metadata and should remain intact.  

S,
ALR

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159067#4159067

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159067



More information about the jboss-dev-forums mailing list