activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1097190 - in /activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp: TcpTransportFactory.java TcpTransportServer.java
Date Wed, 27 Apr 2011 17:38:54 GMT
Author: chirino
Date: Wed Apr 27 17:38:53 2011
New Revision: 1097190

URL: http://svn.apache.org/viewvc?rev=1097190&view=rev
Log:
simpler tcp transport option setup.

Modified:
    activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportFactory.java
    activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportServer.java

Modified: activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportFactory.java?rev=1097190&r1=1097189&r2=1097190&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportFactory.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportFactory.java
Wed Apr 27 17:38:53 2011
@@ -50,8 +50,7 @@ public class TcpTransportFactory impleme
 
         Map<String, String> options = new HashMap<String, String>(URISupport.parseParamters(uri));
         IntrospectionSupport.setProperties(server, options);
-        Map<String, Object> transportOptions = IntrospectionSupport.extractProperties(options,
"transport.");
-        server.setTransportOption(transportOptions);
+        server.setTransportOption(options);
         return server;
     }
 

Modified: activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportServer.java?rev=1097190&r1=1097189&r2=1097190&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportServer.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransportServer.java
Wed Apr 27 17:38:53 2011
@@ -30,7 +30,6 @@ import java.net.*;
 import java.nio.channels.SelectionKey;
 import java.nio.channels.ServerSocketChannel;
 import java.nio.channels.SocketChannel;
-import java.util.HashMap;
 import java.util.Map;
 
 /**
@@ -45,7 +44,7 @@ public class TcpTransportServer implemen
     private final InetSocketAddress bindAddress;
 
     private int backlog = 100;
-    private Map<String, Object> transportOptions;
+    private Map<String, String> transportOptions;
 
     private ServerSocketChannel channel;
     private TransportAcceptListener listener;
@@ -185,37 +184,19 @@ public class TcpTransportServer implemen
     }
 
     protected final void handleSocket(SocketChannel socket) throws Exception {
-        HashMap<String, Object> options = new HashMap<String, Object>();
-//      options.put("maxInactivityDuration", Long.valueOf(maxInactivityDuration));
-//      options.put("maxInactivityDurationInitalDelay", Long.valueOf(maxInactivityDurationInitalDelay));
-//      options.put("trace", Boolean.valueOf(trace));
-//      options.put("soTimeout", Integer.valueOf(soTimeout));
-//      options.put("socketBufferSize", Integer.valueOf(socketBufferSize));
-//      options.put("connectionTimeout", Integer.valueOf(connectionTimeout));
-//      options.put("dynamicManagement", Boolean.valueOf(dynamicManagement));
-//      options.put("startLogging", Boolean.valueOf(startLogging));
-
-        Transport transport = createTransport(socket, options);
-        listener.onAccept(transport);
-    }
-
-    protected Transport createTransport(SocketChannel socketChannel, HashMap<String, Object>
options) throws Exception {
         TcpTransport transport = createTransport();
-        transport.connected(socketChannel);
-        if( options!=null ) {
-            IntrospectionSupport.setProperties(transport, options);
-        }
         if (transportOptions != null) {
             IntrospectionSupport.setProperties(transport, transportOptions);
         }
-        return transport;
+        transport.connected(socket);
+        listener.onAccept(transport);
     }
 
     protected TcpTransport createTransport() {
         return new TcpTransport();
     }
 
-    public void setTransportOption(Map<String, Object> transportOptions) {
+    public void setTransportOption(Map<String, String> transportOptions) {
         this.transportOptions = transportOptions;
     }
 



Mime
View raw message