}
for (final EnterpriseBeanInfo enterpriseBean : ejbJar.enterpriseBeans) {
if (enterpriseBean instanceof StatelessBeanInfo || enterpriseBean instanceof SingletonBeanInfo) {
final PortInfo portInfo = ports.get(enterpriseBean.ejbName);
if (portInfo == null) {
continue;
}
final BeanContext beanContext = containerSystem.getBeanContext(enterpriseBean.ejbDeploymentId);
if (beanContext == null) {
continue;
}
// remove wsdl addresses from global registry
final String address = ejbAddresses.remove(enterpriseBean.ejbDeploymentId);
addressesForApp(appInfo.appId).remove(new EndpointInfo(address, portInfo.wsdlPort, beanContext.getBeanClass().getName()));
if (address != null) {
portAddressRegistry.removePort(portInfo.serviceId, portInfo.wsdlService, portInfo.portId, portInfo.seiInterfaceName);
}
// remove container from web server
final String location = ejbLocations.get(enterpriseBean.ejbDeploymentId);
if (this.wsRegistry != null && location != null) {
this.wsRegistry.removeWsContainer(location);
}
// destroy webservice container
destroyEjbWsContainer(enterpriseBean.ejbDeploymentId);
ejbLocations.remove(enterpriseBean.ejbDeploymentId);
}
}
}
for (final WebAppInfo webApp : appInfo.webApps) {
deployedWebApps.remove(webApp);
final Map<String, PortInfo> ports = new TreeMap<String, PortInfo>();
for (final PortInfo port : webApp.portInfos) {
ports.put(port.serviceLink, port);
}
for (final ServletInfo servlet : webApp.servlets) {
if (servlet.servletClass == null) {
continue;
}
PortInfo portInfo = ports.remove(servlet.servletClass);
if (portInfo == null) {
portInfo = ports.remove(servlet.servletName);
if (portInfo == null) {
continue;
}