-
1. Re: Inconsistent usage of the Ejb3Deployment.deploymentScope
starksm64 May 13, 2008 1:42 PM (in response to brian.stansberry)Right, deployment scope has changed to be a resolving facade notion. What is the problem with the object names?
-
2. Re: Inconsistent usage of the Ejb3Deployment.deploymentScope
brian.stansberry May 13, 2008 2:32 PM (in response to brian.stansberry)It's including an "ear=xxx" attribute in the ObjectName even though there is no ear, and is using the jar name as the attribute value.
This comes from o.j.e.javaee.JavaEEComponentHelper.createObjectName(JavaEEModule module, ...)StringBuilder sb = new StringBuilder(Ejb3Module.BASE_EJB3_JMX_NAME + ","); JavaEEApplication ear = module.getApplication(); if (ear != null) { sb.append("ear="); sb.append(ear.getName()); sb.append(","); } .....
The general concern I have is that existing code expects Ejb3Deployment.getApplication() and getEar() to return null if there is no ear involved. The above is the only usage I find for getApplication(). Searching for other uses of Ejb3Deployment.getEar() I find them in DeploymentPersistenceUnitResolver.getPersistenceUnitDeployment(), in the PersistenceUnitDeployment() constructor and in ProxyFactoryHelper.getDeploymentSummaryFromContainer(). -
3. Re: Inconsistent usage of the Ejb3Deployment.deploymentScope
brian.stansberry May 13, 2008 2:40 PM (in response to brian.stansberry)Ejb3Deployment.getScopeKernelName() also treats the presence of a DeploymentScope as indicating an ear. Don't see any usage of that method anywhere though.
-
4. Re: Inconsistent usage of the Ejb3Deployment.deploymentScope
starksm64 May 13, 2008 3:12 PM (in response to brian.stansberry)In general nothing should depend on the form of the object name. I'll review the ear expectations as part of http://jira.jboss.com/jira/browse/EJBTHREE-1359.
The DeploymentPersistenceUnitResolver has been updated for the change in behavior. -
5. Re: Inconsistent usage of the Ejb3Deployment.deploymentScope
brian.stansberry May 13, 2008 3:32 PM (in response to brian.stansberry)In general nothing should depend on the form of the object name.
Agreed. There's a unit test that builds up an object name, meant to do the same as what the Ejb3Container does. It failed due to the addition of the ear attribute. That's no big deal; test should be better. I was more concerned about the general issue; the object name thing is just what got me looking into it. -
6. Re: Inconsistent usage of the Ejb3Deployment.deploymentScope
brian.stansberry Jun 10, 2008 10:34 AM (in response to brian.stansberry)See also http://www.jboss.com/index.html?module=bb&op=viewtopic&t=135054 for related discussion.
Scott's comment on that thread:I changed the JBoss5DeploymentScope to use an empty "" base name if the deployment is not an ear, so that should help with legacy expectations for the jndi name.
leads me to think the extra data in the ObjectName can be avoided by checking for a null base name. Pretty arcane way to discriminate though.
Getting rid of the extra data is a good thing to do, as the ObjectName forms the container's id, which is transmitted as invocation metadata with every remote request. For persistence units with JBC as a 2nd level cache, a similar approach to building a unique name is used in the JBC FQN for the cache region -- which again gets sent over the wire with any cache change messages.