OMElement failoverElement = epConfig.getFirstChildWithName
(new QName(SynapseConstants.SYNAPSE_NAMESPACE, "failover"));
if (failoverElement != null) {
FailoverEndpoint failoverEndpoint = new FailoverEndpoint();
// set endpoint name
String name = epConfig.getAttributeValue(new QName("name"));
if (name != null) {
failoverEndpoint.setName(name);
}
List<Endpoint> childEndpoints = getEndpoints(
failoverElement, failoverEndpoint, properties);
if(childEndpoints == null || childEndpoints.size() == 0){
String msg = "Invalid Synapse configuration.\n"
+ "A FailOver must have child elements, but the FailOver "
+ "'" + failoverEndpoint.getName() + "' does not have any child elements.";
log.error(msg);
throw new SynapseException(msg);
}
// set endpoints and return
failoverEndpoint.setChildren(getEndpoints(failoverElement, failoverEndpoint, properties));
String dynamicFO = failoverElement.getAttributeValue(new QName("dynamic"));
if (dynamicFO != null && JavaUtils.isFalseExplicitly(dynamicFO)) {
failoverEndpoint.setDynamic(false);
}
// process the parameters
processProperties(failoverEndpoint, epConfig);