JBossMetaData jbmd = unit.getAttachment(JBossMetaData.class);
if (jbmd == null)
throw new IllegalStateException("Deployment unit does not contain application meta data");
WebservicesMetaData wsMetaData = getWebservicesMetaData(unit);
if (wsMetaData == null)
throw new IllegalStateException("Deployment unit does not contain webservices meta data");
WebServiceDeployment webServiceDeployment = unit.getAttachment(WebServiceDeployment.class);
if (webServiceDeployment == null)
throw new IllegalStateException("Deployment unit does not contain webServiceDeployment");
// Copy the attachments
dep.addAttachment(WebservicesMetaData.class, wsMetaData);
dep.addAttachment(JBossMetaData.class, jbmd);
dep.addAttachment(WebServiceDeployment.class, webServiceDeployment);
for (WebserviceDescriptionMetaData wsd : wsMetaData.getWebserviceDescriptions())
{
for (PortComponentMetaData pcmd : wsd.getPortComponents())
{
String ejbLink = pcmd.getEjbLink();
if (ejbLink == null)