}
public void removeEndpoint(QName service, String port) throws EndpointManagementException
{
String key = createEndpointKey(service, port);
ServiceEndpointReference ref = endpointMapping.get(key);
if(null==ref)
throw new IllegalStateException("Unable to resolve ServiceEndpointReference for key: "+key);
if (log.isDebugEnabled()) {
log.debug("Remove endpoint service="+service+" port="+port+" deploymentName="+ref.getDeploymentName()+" ref="+ref);
}
try
{
JBossDSPFactory.getServiceDeployer().undeploy(ref, serverConfig);
// unregister
endpointMapping.remove(key);
if (log.isDebugEnabled()) {
log.debug("Undeployed web service with deploymentName="+ref.getDeploymentName());
}
// remove physical artifacts
File warArchive = new File(ref.getArchiveLocation());
if(warArchive.exists())
{
if(!deleteDirectory(warArchive)) log.warn(warArchive + " could no be deleted");
}
else
{
log.warn(ref.getArchiveLocation() + " cannot be removed (doesn't exist).");
}
if (uddiRegistration!=null) {
uddiRegistration.unRegisterBPELEPR(service, port, ref.getServiceUrl());
}
}
catch (Exception e)
{
throw new EndpointManagementException("Failed to undeploy "+ref.getDeploymentName(), e);
}
}