[jboss-dev-forums] [Design of POJO Server] - Re: appclient remote home regression
ALRubinger
do-not-reply at jboss.com
Tue Jul 22 16:44:05 EDT 2008
"scott.stark at jboss.org wrote : The issue is that the MappedReferenceMetaDataResolverDeployer will have to resolve the ejb-ref differently based on whether the target ejb is a 2.x or 3.x. We should have this info available in the binding policy, so I need to see what is going on with not using it. I guess its just that the server specified binding policy is not in synch with the current ejb3 behavior.
The binding policy should know whether the target is EJB2 or EJB3? Nah, it's just a policy!
This is why I'd moved the policies away from the object model; at deployment we can now attach a binding policy to an EJB, and from then on the caller (Mapped Reference Deployer) doesn't need to choose (because it can do so incorrectly).
So far as the server binding policy being out of sync w/ EJB3 handling...they should both be pointing to the same thing at this point. See code below. Or am I missing somewhere else?
"scott.stark at jboss.org wrote : Is the ejb3 proxy layer using the deployment binding policy for all proxies yet? Looking at the code this does not appear to be the case.
Yes, the Binding Policy is added at deploy-time via:
http://anonsvn.jboss.org/repos/jbossas/trunk/server/src/main/org/jboss/ejb/deployers/EjbMetadataJndiPolicyDecoratorDeployer.java
..and is picked up transparently by the code currently in EJB3 Core (I'm integrating EJB3 Proxy now). From BaseSessionProxyFactory.bindEjb:
// Bind the proxy itself
| log.debug("Binding proxy for " + getContainer().getEjbName() + " in JNDI at " + this.getJndiName());
| Util.rebind(getContainer().getInitialContext(), this.getJndiName(), proxy);
|
| // Bind a proxy per business interface
| //TODO This ugly block should be using polymorphism, but I'll allow it as the proxy mechanism
| // is going to be replaced entirely by EJB3 Proxy soon
| JBossSessionBeanMetaData smd = (JBossSessionBeanMetaData) container.getXml();
| BusinessRemotesMetaData remotes = smd.getBusinessRemotes();
| BusinessLocalsMetaData locals = smd.getBusinessLocals();
| Set<String> businessInterfaces = new HashSet<String>();
| boolean isLocal = this.isLocal();
| if (!isLocal)
| {
| if (remotes != null)
| {
| businessInterfaces.addAll(remotes);
| }
| }
| else
| {
| if (locals != null)
| {
| businessInterfaces.addAll(locals);
| }
| }
| for (String businessInterface : businessInterfaces)
| {
| String jndiName = JbossSessionBeanJndiNameResolver.resolveJndiName(smd, businessInterface);
| log.debug("Binding proxy for " + getContainer().getEjbName() + ", interface " + businessInterface
| + " in JNDI at " + jndiName);
| if (Proxy.isProxyClass(proxy.getClass()))
| {
| for (Class<?> in : proxy.getClass().getInterfaces())
| {
| log.debug("Proxy Interface for JNDI Name " + jndiName + ": " + in);
| }
| }
| Util.rebind(this.getContainer().getInitialContext(), jndiName, proxy);
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165991#4165991
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165991
More information about the jboss-dev-forums
mailing list