if (epData.getEncoding() != null)
{
endpointBuilder.setEncoding(parsePlaceholderValues(epData.getEncoding()));
}
AbstractConnector connector;
if (epData.getConnectorName() != null)
{
connector = (AbstractConnector) muleContext.getRegistry().lookupConnector(parsePlaceholderValues(epData.getConnectorName()));
}
else if (epData.getConnector() != null)
{
connector = (AbstractConnector) epData.getConnector();
}
else
{
//We always create a new connecotr for annotations when one has not been configured
MuleEndpointURI uri = new MuleEndpointURI(parsePlaceholderValues(epData.getAddress()), muleContext);
connector = (AbstractConnector) transportFactory.createConnector(uri);
//The ibeans transport factory will not always create a new connector, check before registering
if (muleContext.getRegistry().lookupConnector(connector.getName()) == null)
{
muleContext.getRegistry().registerConnector(connector);
}
}
endpointBuilder.setConnector(connector);
//Set threading for this connector. Note we simplify by setting all profiles with a single value 'threads'
//that can be set by the user
String threadsString = (String) epData.getProperties().get("threads");
if (threadsString != null)
{
int threads = Integer.valueOf(threadsString);
connector.setMaxDispatchersActive(threads);
connector.setMaxRequestersActive(threads);
connector.getReceiverThreadingProfile().setMaxThreadsActive(threads);
connector.getReceiverThreadingProfile().setMaxThreadsIdle(threads);
}
if (epData.getName() != null)
{
endpointBuilder.setName(parsePlaceholderValues(epData.getName()));