{
newUriString = parseURIString(newUriString, event.getMessage());
}
catch (final ExpressionRuntimeException e)
{
throw new DispatchException(event, this, e);
}
if (logger.isDebugEnabled())
{
logger.debug("Uri after parsing is: " + newUriString);
}
try
{
final MuleEndpointURI uri = new MuleEndpointURI(newUriString, getMuleContext());
uri.initialise();
setEndpointURI(uri);
return getEndpointURI();
}
catch (final Exception e)
{
throw new DispatchException(CoreMessages.templateCausedMalformedEndpoint(uriTemplate,
newUriString), event, this, e);
}
}