class UriEndpointMapping extends AbstractMapBasedEndpointMapping {

	@Override
	protected String getLookupKeyForMessage(MessageContext messageContext) throws Exception {
		TransportContext transportContext = TransportContextHolder.getTransportContext();
		if (transportContext != null) {
			WebServiceConnection connection = transportContext.getConnection();
			if (connection != null) {
				URI connectionUri = connection.getUri();
				if (usePath) {
					return connectionUri.getPath();
				} else {
					return connectionUri.toString();
				}
			}
		}
		return null;
	}

}