/* (non-Javadoc)
* @see org.mule.endpoint.EndpointCache#getInboundEndpoint(java.lang.String, org.mule.MessageExchangePattern)
*/
public InboundEndpoint getInboundEndpoint(String uri, MessageExchangePattern mep) throws MuleException
{
InboundEndpoint endpoint = (InboundEndpoint) inboundEndpointCache.get(uri + ":" + mep.toString());
if (endpoint == null)
{
EndpointBuilder endpointBuilder = muleContext.getRegistry()
.lookupEndpointFactory()
.getEndpointBuilder(uri);
endpointBuilder.setExchangePattern(mep);
endpoint = muleContext.getEndpointFactory().getInboundEndpoint(endpointBuilder);
InboundEndpoint concurrentlyAddedEndpoint = (InboundEndpoint) inboundEndpointCache.putIfAbsent(
uri + ":" + mep.toString(), endpoint);
if (concurrentlyAddedEndpoint != null)
{
return concurrentlyAddedEndpoint;
}