[jboss-dev-forums] [Design of POJO Server] - ReferenceMetaDataResolverDeployer is wrong
adrian@jboss.org
do-not-reply at jboss.com
Tue Dec 4 07:58:56 EST 2007
The ReferenceMetaDataResolverDeployer (RMDRD) is wrong
in that it updates the mapped-name/jndi-name with the resolved jndi-name.
This breaks the reversability of the model and will also confuse things
with the profile service.
Example:
I have ejb1 with jndi-name="ejb1jndiName"
I have ejb2 with ejb-link="ejb1"
The RMDRD will do EJBReference.setMappedName("ejb1JndiName");
| if(link != null)
| target = findEjbLink(unit, link);
| if(target == null)
| unresolvedRefs.add(ref.getEjbRefName()+"/ejb-ref/"+link);
| else
| ref.setMappedName(target);
|
When the ManagedObjects are retrieved for this deployment,
the EJBReferfence now has a mapped-name and so it will be saved
and never re-resolved on a deploy from the profile service.
If I then use the managed console (profile service) to change the
jndi-name of ejb1 ejb1JndiName -> ejb1ChangedName
the EJBReference is now invalid, but it won't be re-resolved because
the mapped-name is not null.
Instead what should be happening is that on the ResourceInjectionMetaData
there should be:
| private String resolvedJndiName;
|
| public String getResolvedJndiName()
| {
| return resolvedJndiName;
| }
|
| @XmlTransient // not included in xml model
| public void setResolvedJndiName(String jndiName)
| {
| this.resolvedJndiName = resolvedJndiName;
| }
|
The RMDRD should setting the resolvedJndiName and the
containers should be using getResolvedJndiName(), rather than getMapped/JndiName().
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110170#4110170
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110170
More information about the jboss-dev-forums
mailing list