camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r655333 - /activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java
Date Sun, 11 May 2008 16:33:39 GMT
Author: davsclaus
Date: Sun May 11 09:33:39 2008
New Revision: 655333

URL: http://svn.apache.org/viewvc?rev=655333&view=rev
Log:
CAMEL-433: better validation when creating an endpoint from uri

Modified:
    activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java

Modified: activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java?rev=655333&r1=655332&r2=655333&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java
(original)
+++ activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaComponent.java
Sun May 11 09:33:39 2008
@@ -139,6 +139,7 @@
             acceptorConfig.getFilterChain().addLast("logger", new LoggingFilter());
         }
 
+        removeKnownParameters(parameters);
         MinaEndpoint endpoint = new MinaEndpoint(uri, this, address, acceptor, acceptorConfig,
connector, connectorConfig, lazySessionCreation, timeout, transferExchange);
 
         // set sync or async mode after endpoint is created
@@ -174,6 +175,18 @@
         addCodecFactory(config, codecFactory);
     }
 
+    private void removeKnownParameters(Map parameters) {
+        // remove the known parameters this component supports
+        parameters.remove("lazySessionCreation");
+        parameters.remove("timeout");
+        parameters.remove("transferExchange");
+        parameters.remove("sync");
+        parameters.remove("minaLogger");
+        parameters.remove("codec");
+        parameters.remove("textline");
+        parameters.remove("encoding");
+    }
+
     protected MinaEndpoint createDatagramEndpoint(String uri, URI connectUri, Map parameters)
{
         IoAcceptor acceptor = new DatagramAcceptor();
         SocketAddress address = new InetSocketAddress(connectUri.getHost(), connectUri.getPort());
@@ -202,6 +215,7 @@
             acceptorConfig.getFilterChain().addLast("logger", new LoggingFilter());
         }
 
+        removeKnownParameters(parameters);
         MinaEndpoint endpoint = new MinaEndpoint(uri, this, address, acceptor, acceptorConfig,
connector, connectorConfig, lazySessionCreation, timeout, transferExchange);
 
         // set sync or async mode after endpoint is created



Mime
View raw message