* @return Endpoint implementation for the given configuration.
*/
private Endpoint createEndpointWithName(OMElement epConfig, boolean anonymousEndpoint,
Properties properties) {
Endpoint ep = createEndpoint(epConfig, anonymousEndpoint, properties);
OMElement descriptionElem = epConfig.getFirstChildWithName(DESCRIPTION_Q);
if (descriptionElem != null) {
ep.setDescription(descriptionElem.getText());
}
// if the endpoint doesn't have a name we will generate a unique name.
if (anonymousEndpoint && ep.getName() == null) {
String uuid = UIDGenerator.generateUID();
uuid = uuid.replace(':', '_');
ep.setName(ENDPOINT_NAME_PREFIX + uuid);
if (ep instanceof AbstractEndpoint) {
((AbstractEndpoint) ep).setAnonymous(true);
}
}
OMAttribute onFaultAtt = epConfig.getAttribute(ON_FAULT_Q);
if (onFaultAtt != null) {
ep.setErrorHandler(onFaultAtt.getAttributeValue());
}
return ep;
}