You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/03/30 09:13:21 UTC

[camel] branch master updated: Fixed creating endpoints in camel-milo server

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new a4c0f88  Fixed creating endpoints in camel-milo server
a4c0f88 is described below

commit a4c0f888f7c086c184aa4517f029ed661e6db2e1
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Mar 30 11:12:36 2020 +0200

    Fixed creating endpoints in camel-milo server
---
 .../component/milo/server/MiloServerComponent.java  | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)

diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
index 240ad00..96e7110 100644
--- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
+++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/server/MiloServerComponent.java
@@ -81,7 +81,6 @@ public class MiloServerComponent extends DefaultComponent {
     private static final String URL_CHARSET = "UTF-8";
 
     private final List<Runnable> runOnStop = new LinkedList<>();
-    private final Map<String, MiloServerEndpoint> endpoints = new HashMap<>();
 
     private int port;
     private String namespaceUri = DEFAULT_NAMESPACE_URI;
@@ -376,21 +375,9 @@ public class MiloServerComponent extends DefaultComponent {
 
     @Override
     protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters) throws Exception {
-        synchronized (this) {
-            if (remaining == null || remaining.isEmpty()) {
-                return null;
-            }
-
-            MiloServerEndpoint endpoint = this.endpoints.get(remaining);
-
-            if (endpoint == null) {
-                endpoint = new MiloServerEndpoint(uri, remaining, this);
-                setProperties(endpoint, parameters);
-                this.endpoints.put(remaining, endpoint);
-            }
-
-            return endpoint;
-        }
+        Endpoint endpoint = new MiloServerEndpoint(uri, remaining, this);
+        setProperties(endpoint, parameters);
+        return endpoint;
     }
 
     /**
@@ -514,9 +501,7 @@ public class MiloServerComponent extends DefaultComponent {
 
     /**
      * Set user password combinations in the form of "user1:pwd1,user2:pwd2"
-     * <p>
      * Usernames and passwords will be URL decoded
-     * </p>
      */
     public void setUserAuthenticationCredentials(final String userAuthenticationCredentials) {
         this.userAuthenticationCredentials = userAuthenticationCredentials;