activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r395640 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp: TcpTransport.java TcpTransportFactory.java TcpTransportServer.java
Date Thu, 20 Apr 2006 16:57:57 GMT
Author: chirino
Date: Thu Apr 20 09:57:56 2006
New Revision: 395640

URL: http://svn.apache.org/viewcvs?rev=395640&view=rev
Log:
Support "transport." properties when creating a tranport server
Support "socket." properties when creating a transport.

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

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java?rev=395640&r1=395639&r2=395640&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
Thu Apr 20 09:57:56 2006
@@ -28,12 +28,14 @@
 import java.net.SocketTimeoutException;
 import java.net.URI;
 import java.net.UnknownHostException;
+import java.util.Map;
 
 import org.apache.activeio.command.WireFormat;
 import org.apache.activemq.Service;
 import org.apache.activemq.command.Command;
 import org.apache.activemq.transport.Transport;
 import org.apache.activemq.transport.TransportThreadSupport;
+import org.apache.activemq.util.IntrospectionSupport;
 import org.apache.activemq.util.ServiceStopper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -60,6 +62,8 @@
     private int minmumWireFormatVersion;
     private InetSocketAddress socketAddress;
 
+    private Map socketOptions;
+
     
     /**
      * Construct basic helpers
@@ -322,5 +326,9 @@
         if (dataIn != null) {
             dataIn.close();
         }
+    }
+
+    public void setSocketOptions(Map socketOptions) {
+        IntrospectionSupport.setProperties(socket, socketOptions);
     }
 }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java?rev=395640&r1=395639&r2=395640&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
Thu Apr 20 09:57:56 2006
@@ -52,7 +52,9 @@
             TcpTransportServer server = new TcpTransportServer(location, serverSocketFactory);
             server.setWireFormatFactory(createWireFormatFactory(options));
             IntrospectionSupport.setProperties(server, options);
-
+            Map transportOptions = IntrospectionSupport.extractProperties(options, "transport.");
+            server.setTransportOption(transportOptions);
+            
             return server;
         }
         catch (URISyntaxException e) {
@@ -63,6 +65,9 @@
     public Transport configure(Transport transport, WireFormat format, Map options) {
         IntrospectionSupport.setProperties(transport, options);
         TcpTransport tcpTransport = (TcpTransport) transport;
+        Map socketOptions = IntrospectionSupport.extractProperties(options, "socket."); 
      
+        tcpTransport.setSocketOptions(socketOptions);
+
         if (tcpTransport.isTrace()) {
             transport = new TransportLogger(transport);
         }
@@ -82,6 +87,9 @@
     public Transport compositeConfigure(Transport transport, WireFormat format, Map options)
{
         IntrospectionSupport.setProperties(transport, options);
         TcpTransport tcpTransport = (TcpTransport) transport;
+        Map socketOptions = IntrospectionSupport.extractProperties(options, "socket."); 
      
+        tcpTransport.setSocketOptions(socketOptions);
+
         if (tcpTransport.isTrace()) {
             transport = new TransportLogger(transport);
         }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java?rev=395640&r1=395639&r2=395640&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
Thu Apr 20 09:57:56 2006
@@ -26,6 +26,7 @@
 import java.net.URISyntaxException;
 import java.net.UnknownHostException;
 import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.activeio.command.WireFormat;
 import org.apache.activeio.command.WireFormatFactory;
@@ -55,6 +56,7 @@
     private long maxInactivityDuration = 30000;
     private int minmumWireFormatVersion;
     private boolean trace;
+    private Map transportOptions;
     
     public TcpTransportServer(URI location, ServerSocketFactory serverSocketFactory) throws
IOException, URISyntaxException {
         super(location);
@@ -128,6 +130,7 @@
                         options.put("maxInactivityDuration", new Long(maxInactivityDuration));
                         options.put("minmumWireFormatVersion", new Integer(minmumWireFormatVersion));
                         options.put("trace", new Boolean(trace));
+                        options.putAll(transportOptions);
                         WireFormat format = wireFormatFactory.createWireFormat();
                         TcpTransport transport = new TcpTransport(format, socket);
                         Transport configuredTransport = transportFactory.configure(transport,
format, options);
@@ -212,5 +215,9 @@
 
     public InetSocketAddress getSocketAddress() {
         return (InetSocketAddress)serverSocket.getLocalSocketAddress();
+    }
+
+    public void setTransportOption(Map transportOptions) {
+        this.transportOptions = transportOptions;
     }
 }



Mime
View raw message