[jboss-dev-forums] [Design of EJB 3.0] - Re: Annotated EJB References in MappedReferenceMetadataDeplo

scott.stark@jboss.org do-not-reply at jboss.com
Thu May 8 02:23:41 EDT 2008


With the current 1.0.0.Beta13 release of metadata and updates to MappedReferenceMetadataDeployer, the @EJB(home) and @EJB(localBusiness) resolve to:


  | 2008-05-07 22:43:48,807 DEBUG [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (RMI TCP Connection(4)-127.0.0.1) Processing unit=ejbthree1154.jar,
  |  structure:ejbthree1154.jar+EjbEndpoint:ejbName=TestBean,ejbClass=org.jboss.ejb3.test.ejbthree1154.TestBean
  | ,home=org.jboss.ejb3.test.ejbthree1154.TestRemoteHome,BusinessLocals: [org.jboss.ejb3.test.ejbthree1154.TestLocalBusiness],BusinessRemotes: [org.jboss.ejb3.test.ejbthree1154.TestRemoteBusiness]
  | +EjbEndpoint:ejbName=DelegateBean,ejbClass=org.jboss.ejb3.test.ejbthree1154.Dele
  | gateBean,BusinessRemotes: [org.jboss.ejb3.test.ejbthree1154.DelegateRemoteBusiness]
  | ++ at EJB(home) -> mappedName=null| resolvedJndiName=TestBean/localHome
  | ++ at EJB(localBusiness) -> mappedName=null| resolvedJndiName=TestBean/org.jboss.ejb3.test.ejbthree1154.TestLocalBusiness
  | 

as determined by the new determineResolvedJndiName(iface) method on the JBossEnterpriseBeanMetaData, but the bindings for the interfaces on the bean are:

  |   +- TestBean (class: org.jnp.interfaces.NamingContext)
  |   |   +- remoteHome (proxy: $Proxy128 implements interface org.jboss.ejb3.test.ejbthree1154.TestRemoteHome)
  |   |   +- local (proxy: $Proxy129 implements interface org.jboss.ejb3.test.ejbthree1154.TestLocalBusiness,interface org.jboss.ejb3.proxy.JBossProxy)
  |   |   +- remote (proxy: $Proxy126 implements interface org.jboss.ejb3.proxy.JBossProxy,interface org.jboss.ejb3.test.ejbthree1154.TestRemoteBusiness)
  |   |   +- localHome (proxy: $Proxy131 implements interface org.jboss.ejb3.test.ejbthree1154.TestLocalHome)
  | 

The logic for the BasicJndiBindingPolicy is to use the /local, /localHome, /remote and /remoteHome suffixes for the interfaces matching the metadata getLocal(), getLocalHome(), getRemote() and getHome() values. All others are bound under a suffix equal to the interface name. Here org.jboss.ejb3.test.ejbthree1154.TestLocalBusiness is a BusinessLocal interface rather than the getLocal() value so its expected to be bound under 
TestBean/org.jboss.ejb3.test.ejbthree1154.TestLocalBusiness rather than TestBean/local. 

So what happens when there is a getLocal() and BusinessLocal interfaces? Either the default binding policy needs to be updated or the proxy layer needs to use the new determineResolvedJndiName(iface, summary) method to get the jndi name to use.


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

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



More information about the jboss-dev-forums mailing list