{
log.warn("Can't construct URL for: " + ourPath);
return null;
}
DeploymentUnit targetUnit = null;
try
{
DeploymentContext ctx = server.getDeploymentContext(target.toString());
targetUnit = ctx.getDeploymentUnit();
}
catch (Exception e)
{
log.warn("Got Exception when looking for DeploymentUnit: " + e);
return null;
}
if (targetUnit == null)
{
log.warn("Can't locate DeploymentUnit for target: " + target);
return null;
}
if (log.isTraceEnabled())
log.trace("Found appropriate DeploymentUnit: " + targetUnit);
if (targetUnit.getAttachment(JBossMetaData.class) != null)
{
JBossMetaData appMD = targetUnit.getAttachment(JBossMetaData.class);
return appMD.getAssemblyDescriptor().getMessageDestination(destinationName);
}
if (targetUnit.getAttachment(JBossWebMetaData.class) != null)
{
JBossWebMetaData webMD = targetUnit.getAttachment(JBossWebMetaData.class);
return webMD.getMessageDestination(destinationName);
}
else
{
log.warn("DeploymentUnit " + targetUnit + " is not an EJB .jar " + "file!");