return instance;
}
public Endpoint createEndpoint(OMElement epConfig, boolean anonymousEndpoint) {
AddressEndpoint addressEndpoint = new AddressEndpoint();
if (!anonymousEndpoint) {
OMAttribute name = epConfig.getAttribute(new QName(
org.apache.synapse.config.xml.Constants.NULL_NAMESPACE, "name"));
if (name != null) {
addressEndpoint.setName(name.getAttributeValue());
}
}
OMElement addressElement = epConfig.getFirstChildWithName
(new QName(Constants.SYNAPSE_NAMESPACE, "address"));
if (addressElement != null) {
EndpointDefinition endpoint = createEndpointDefinition(addressElement);
addressEndpoint.setEndpoint(endpoint);
// set the suspend on fail duration.
OMElement suspendElement = addressElement.getFirstChildWithName(new QName(
Constants.SYNAPSE_NAMESPACE,
org.apache.synapse.config.xml.Constants.SUSPEND_DURATION_ON_FAILURE));
if (suspendElement != null) {
String suspend = suspendElement.getText();
try {
if (suspend != null) {
long suspendDuration = Long.parseLong(suspend.trim());
addressEndpoint.setSuspendOnFailDuration(suspendDuration * 1000);
}
} catch (NumberFormatException e) {
handleException("The suspend duration should be specified as a valid number :: "
+ e.getMessage(), e);