*/
protected void doPublish(String addr) {
checkPublishPermission();
checkPublishable();
ServerImpl serv = null;
ClassLoaderHolder loader = null;
try {
if (bus != null) {
ClassLoader newLoader = bus.getExtension(ClassLoader.class);
if (newLoader != null) {
loader = ClassLoaderUtils.setThreadContextClassloader(newLoader);
}
}
serv = getServer(addr);
if (addr != null) {
EndpointInfo endpointInfo = serv.getEndpoint().getEndpointInfo();
if (!endpointInfo.getAddress().contains(addr)) {
endpointInfo.setAddress(addr);
}
if (publishedEndpointUrl != null) {
endpointInfo.setProperty(WSDLGetUtils.PUBLISHED_ENDPOINT_URL, publishedEndpointUrl);
}
if (publishedEndpointUrl != null && wsdlLocation != null) {
//early update the publishedEndpointUrl so that endpoints in the same app sharing the same wsdl
//do not require all of them to be queried for wsdl before the wsdl is finally fully updated
Definition def = endpointInfo.getService()
.getProperty(WSDLServiceBuilder.WSDL_DEFINITION, Definition.class);
if (def == null) {
def = bus.getExtension(WSDLManager.class).getDefinition(wsdlLocation);
}
new WSDLGetUtils().updateWSDLPublishedEndpointAddress(def, endpointInfo);
}
if (null != properties) {
for (Entry<String, Object> entry : properties.entrySet()) {
endpointInfo.setProperty(entry.getKey(), entry.getValue());
}
}
this.address = endpointInfo.getAddress();
}
serv.start();
publishable = false;
} catch (Exception ex) {
try {
stop();
} catch (Exception e) {