{
if (log.isTraceEnabled())
log.trace("Resolving absolute link, di: " + unit);
// Search current DeploymentUnit
MessageDestinationMetaData md = null;
MessageDestinationsMetaData mds = null;
if (unit.getAttachment(JBossMetaData.class) != null)
{
JBossMetaData appMD = unit.getAttachment(JBossMetaData.class);
mds = appMD.getAssemblyDescriptor().getMessageDestinations();
if(mds != null)
{
searched.addAll(mds);
md = mds.get(link);
if (md != null)
return md;
}
}
if (unit.getAttachment(JBossWebMetaData.class) != null)
{
JBossWebMetaData webMD = unit.getAttachment(JBossWebMetaData.class);
mds = webMD.getMessageDestinations();
if(mds != null)
{
searched.addAll(mds);
md = mds.get(link);
if (md != null)
return md;
}
}
// Search each subcontext
Iterator<DeploymentUnit> it = unit.getChildren().iterator();
while (it.hasNext())
{
DeploymentUnit child = it.next();
MessageDestinationMetaData mdMD = resolveAbsoluteMessageDestination(child, link, searched);
if (mdMD != null)
return mdMD;
}
// Not found