[Design of EJB 3.0] - Re: jndi name issues
by wolfc
I've re-edited my post. It's forum weirdness, because the text was still there.
"alex.loubyansky(a)jboss.com" wrote : "Carlo" wrote : foo.ear/bar.jar/MyBean it will become "foo/MyBean"
|
| If we are going to follow this format then I don't see how the full JNDI name can be resolved on the metadata level. Since there is no info about parent deployment units. So, it seems like the JNDI name resolution is going to be split into the prefix and suffix parts (the later being resolved in the metadata).
We must have a notion of parent deployment units at metadata level, because else we'll have a problem with the persistence unit deployer (EJB3 Persisitence 6.2.2 Persistence Unit Scope).
"scott.stark(a)jboss.org" wrote : For 3 we need a utility class that properly looks at the reference type to determine if this is a home/local-home, remote or local, business interface lookup.
Not really, you can just lookup "[ejbName]/[interface]".
"ALRubinger" wrote : If we change the format "earName/jarName/beanName" to "earName/beanName", we lose the guarantee that the binding will be unique. Why remove "jarName" from here?
Being inline with our own documentation. :-)
We could change both.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147606#4147606
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147606
16 years, 5 months
[Design of EJB 3.0] - Re: jndi name issues
by ALRubinger
"wolfc" wrote : It should work as follows:
|
| By default beans are bound in JNDI in the form "", regardless which interfaces are defined on the bean.
| Depending on whether an EJB3 deployment is packaged within an EAR the JNDI name will be prepended by the short name of the EAR. So for foo.ear/bar.jar/MyBean it will become "foo/MyBean".
This should be handled by the JndiBindingPolicy, and the default in place is currently an implementation of the legacy.
If we change the format "earName/jarName/beanName" to "earName/beanName", we lose the guarantee that the binding will be unique. Why remove "jarName" from here?
Remember, JndiBindingPolicy is in place to handle cases we haven't considered or need further definition. EJBs deployed in webapps need to be unique per WAR, for instance.
"wolfc" wrote : The final JNDI name can be overriden with the use of @LocalBinding, @RemoteBinding or the equivalents from jboss.xml.
Yes, but XML must override our annotations. So the hierarchy is:
JndiBindingPolicy > @RemoteBinding.jndiBinding/(a)LocalBinding.jndiBinding > jboss.xml
S,
ALR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147560#4147560
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147560
16 years, 5 months
[Design of EJB 3.0] - Re: jndi name issues
by scott.stark@jboss.org
Carlo's post seems to have lost information in the quoted strings.
There will have to be an org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary input into the jndi name process, so the metadata layer only has the JBossMetaData with the DefaultJndiBindingPolicy. What Carlo is describing is the ejb3 DefaultJndiBindingPolicy. The ejb2x DefaultJndiBindingPolicy will be different to conform to its legacy defaults.
The @LocalBinding, @RemoteBinding or the equivalents from jboss.xml have to be incorporated into the JBossMetaData and the DefaultJndiBindingPolicy impls honor those overrides.
What matters is that we can unit test the jndi names in the metadata layer and have this match the server environment behavior. So a deployer needing to know the jndi name for a bean would:
1. Create the EjbDeploymentSummary(DeploymentUnit, JBossEnterpriseBeanMetaData)
2. Obtain the DefaultJndiBindingPolicy from the JBossEnterpriseBeanMetaData.JBossMetaData + DeploymentUnit.classLoader
3. Based on the reference info, call the approriate DefaultJndiBindingPolicy.get*JndiName(unitSummary) method to obtain the jndi name that should be used in the reference lookup.
For 3 we need a utility class that properly looks at the reference type to determine if this is a home/local-home, remote or local, business interface lookup.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147557#4147557
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147557
16 years, 5 months