}
if (endpointReference != null) {
ei.setAddress(endpointReference);
}
Endpoint ep = service.getEndpoints().get(ei.getName());
if (ep == null) {
ep = serviceFactory.createEndpoint(ei);
((EndpointImpl)ep).initializeActiveFeatures(getFeatures());
} else {
serviceFactory.setEndpointName(ei.getName());
if (ep.getActiveFeatures() == null) {
((EndpointImpl)ep).initializeActiveFeatures(getFeatures());
}
}
if (properties != null) {
ep.putAll(properties);
}
service.getEndpoints().put(ep.getEndpointInfo().getName(), ep);
if (getInInterceptors() != null) {
ep.getInInterceptors().addAll(getInInterceptors());
ep.getInInterceptors().add(WSDLGetInterceptor.INSTANCE);
}
if (getOutInterceptors() != null) {
ep.getOutInterceptors().addAll(getOutInterceptors());
}
if (getInFaultInterceptors() != null) {
ep.getInFaultInterceptors().addAll(getInFaultInterceptors());
}
if (getOutFaultInterceptors() != null) {
ep.getOutFaultInterceptors().addAll(getOutFaultInterceptors());
}
serviceFactory.sendEvent(FactoryBeanListener.Event.ENDPOINT_SELECTED, ei, ep,
serviceFactory.getServiceClass(), getServiceClass());
return ep;
}