Author: davsclaus
Date: Mon Apr 16 19:44:39 2012
New Revision: 1326775

URL: http://svn.apache.org/viewvc?rev=1326775&view=rev
Log:
Polished

Modified:
    
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=1326775&r1=1326774&r2=1326775&view=diff
==============================================================================
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
 Mon Apr 16 19:44:39 2012
@@ -426,14 +426,14 @@ public class DefaultCamelContext extends
             throw new ResolveEndpointFailedException(uri, e);
         }
 
-        // normalize uri so we can do endpoint hits with minor mistakes and 
parameters is not in the same order
-        uri = normalizeEndpointUri(uri);
-
-        log.trace("Getting endpoint with normalized uri: {}", uri);
+        // endpoint key will normalize uri so we can do endpoint hits with 
minor mistakes and parameters is not in the same order
+        // and also validate the uri, if the uri is invalid an 
ResolveEndpointFailedException is thrown from the getEndpointKey
+        EndpointKey key = getEndpointKey(uri);
+        log.trace("Getting endpoint with normalized uri: {}", key);
 
         Endpoint answer;
         String scheme = null;
-        answer = endpoints.get(getEndpointKey(uri));
+        answer = endpoints.get(key);
         if (answer == null) {
             try {
                 // Use the URI prefix to find the component.
@@ -516,6 +516,8 @@ public class DefaultCamelContext extends
         ObjectHelper.notEmpty(uri, "uri");
         ObjectHelper.notNull(endpoint, "endpoint");
 
+        // if there is endpoint strategies, then use the endpoints they return
+        // as this allows to intercept endpoints etc.
         for (EndpointStrategy strategy : endpointStrategies) {
             endpoint = strategy.registerEndpoint(uri, endpoint);
         }


Reply via email to