}
private Connector getConnector(EndpointURI endpointURI) throws EndpointException
{
String scheme = getScheme();
TransportFactory factory = new TransportFactory(muleContext);
Connector connector;
try
{
if (uriBuilder.getEndpoint().getConnectorName() != null)
{
connector = muleContext.getRegistry().lookupConnector(
uriBuilder.getEndpoint().getConnectorName());
if (connector == null)
{
throw new TransportFactoryException(CoreMessages.objectNotRegistered("Connector",
uriBuilder.getEndpoint().getConnectorName()));
}
}
else if (isAlwaysCreateConnector())
{
connector = factory.createConnector(endpointURI);
muleContext.getRegistry().registerConnector(connector);
}
else
{
connector = factory.getConnectorByProtocol(scheme);
if (connector == null)
{
connector = factory.createConnector(endpointURI);
muleContext.getRegistry().registerConnector(connector);
}
}
}
catch (Exception e)