[jboss-dev-forums] [Design of EJB 3.0] - Non-deterministic Default JNDI Name
ALRubinger
do-not-reply at jboss.com
Wed Oct 8 02:07:54 EDT 2008
Assume:
@Stateless
| @Remote(MultipleRemoteBindingsTest.class)
| @RemoteBindings(
| {@RemoteBinding(jndiBinding = MultipleRemoteBindingsTest.JNDI_BINDING_1),
| @RemoteBinding(jndiBinding = MultipleRemoteBindingsTest.JNDI_BINDING_2)})
| public class MultipleRemoteBindingsTestBean{}
The JNDI Name for this bean is non-deterministic, as there's nothing to signal a true default.
JBossSessionBeanMetaData smd = ...; // This is decorated
| String jndiName = smd.getJndiName();
At the moment it's JBossSessionPolicyDecorator that chooses the first populated @RemoteBinding.jndiBinding to be default:
@Override
| public String getMappedName()
| {
| // Obtain remote bindings
| List<RemoteBindingMetaData> bindings = this.delegate.getRemoteBindings();
|
| // If defined, use the first remote binding as a JNDI default
| if (bindings != null && bindings.size() > 0)
| {
| String jndiName = bindings.get(0).getJndiName();
| if (jndiName != null && jndiName.length() > 0)
| {
| return jndiName;
| }
| }
|
| ...}
S,
ALR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180929#4180929
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180929
More information about the jboss-dev-forums
mailing list