StringBuilder name = new StringBuilder(Endpoint.SEPID_DOMAIN + ":");
name.append(Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextRoot.substring(1) + ",");
name.append(Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ep.getShortName());
// Append the JMS destination, for an MDB endpoint
EJBArchiveMetaData uapp = dep.getAttachment(EJBArchiveMetaData.class);
if (uapp != null)
{
EJBMetaData bmd = uapp.getBeanByEjbName(ep.getShortName());
if (bmd instanceof MDBMetaData)
{
String destName = ((MDBMetaData)bmd).getDestinationJndiName();
name.append(",jms=" + destName);
}