geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r707967 - in /geronimo/gshell/trunk/gshell-remote/gshell-whisper/src: main/java/org/apache/geronimo/gshell/whisper/transport/ main/java/org/apache/geronimo/gshell/whisper/transport/base/ main/java/org/apache/geronimo/gshell/whisper/transpor...
Date Sun, 26 Oct 2008 10:47:13 GMT
Author: jdillon
Date: Sun Oct 26 03:47:12 2008
New Revision: 707967

URL: http://svn.apache.org/viewvc?rev=707967&view=rev
Log:
Completely do away with transport configuration

Removed:
    geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseConfiguration.java
Modified:
    geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Transport.java
    geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportFactory.java
    geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportServer.java
    geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java
    geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportFactory.java
    geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportFactory.java
    geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportFactory.java
    geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportFactoryTest.java

Modified: geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Transport.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Transport.java?rev=707967&r1=707966&r2=707967&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Transport.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Transport.java
Sun Oct 26 03:47:12 2008
@@ -19,7 +19,6 @@
 
 package org.apache.geronimo.gshell.whisper.transport;
 
-import org.apache.geronimo.gshell.whisper.transport.base.BaseConfiguration;
 import org.apache.mina.common.IoConnector;
 
 import java.io.Closeable;
@@ -42,8 +41,4 @@
     Session getSession();
 
     void close();
-
-    void setConfiguration(BaseConfiguration config);
-
-    BaseConfiguration getConfiguration();
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportFactory.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportFactory.java?rev=707967&r1=707966&r2=707967&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportFactory.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportFactory.java
Sun Oct 26 03:47:12 2008
@@ -19,7 +19,6 @@
 
 package org.apache.geronimo.gshell.whisper.transport;
 
-import org.apache.geronimo.gshell.whisper.transport.base.BaseConfiguration;
 import org.apache.mina.common.IoHandler;
 
 import java.net.URI;
@@ -33,11 +32,7 @@
 {
     String getScheme();
     
-    T connect(URI remote, URI local, BaseConfiguration config) throws Exception;
-
     T connect(URI remote, URI local, IoHandler handler) throws Exception;
     
-    S bind(URI location, BaseConfiguration config) throws Exception;
-
     S bind(URI location, IoHandler handler) throws Exception;
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportServer.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportServer.java?rev=707967&r1=707966&r2=707967&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportServer.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportServer.java
Sun Oct 26 03:47:12 2008
@@ -19,7 +19,6 @@
 
 package org.apache.geronimo.gshell.whisper.transport;
 
-import org.apache.geronimo.gshell.whisper.transport.base.BaseConfiguration;
 import org.apache.mina.common.IoAcceptor;
 
 import java.io.Closeable;
@@ -38,8 +37,4 @@
     T getAcceptor();
 
     void close();
-
-    void setConfiguration(BaseConfiguration config);
-
-    BaseConfiguration getConfiguration();
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java?rev=707967&r1=707966&r2=707967&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java
Sun Oct 26 03:47:12 2008
@@ -73,46 +73,15 @@
         return Yarn.render(this);
     }
 
-    //
-    // Configuration
-    //
-
-    private BaseConfiguration config;
-
-    protected BaseConfiguration createConfiguration() {
-        return new BaseConfiguration();
-    }
-
-    public synchronized BaseConfiguration getConfiguration() {
-        if (config == null) {
-            config = createConfiguration();
-
-            log.debug("Created configuration: {}", config);
-        }
-
-        return config;
-    }
-
-    public synchronized void setConfiguration(final BaseConfiguration config) {
-        assert config != null;
-
-        this.config = config;
-
-        log.debug("Using configuration: {}", config);
-    }
-
     private IoHandler handler;
 
-    protected synchronized IoHandler createHandler() throws Exception {
-        return getConfiguration().getHandler();
+    public synchronized void setHandler(final IoHandler handler) {
+        assert handler != null;
+        this.handler = handler;
     }
 
     protected synchronized IoHandler getHandler() throws Exception {
         if (handler == null) {
-            handler = createHandler();
-        }
-
-        if (handler == null) {
             throw new IllegalStateException("Handler has not been configured");
         }
         

Modified: geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportFactory.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportFactory.java?rev=707967&r1=707966&r2=707967&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportFactory.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportFactory.java
Sun Oct 26 03:47:12 2008
@@ -65,25 +65,13 @@
         return (T)container.getBean(scheme + "Transport", Transport.class);
     }
 
-    public T connect(final URI remote, final URI local, final BaseConfiguration config) throws
Exception {
-        assert remote != null;
-        assert config != null;
-        // local can be null
-
-        T transport = createTransport();
-        transport.setConfiguration(config);
-        transport.connect(remote, local);
-
-        return transport;
-    }
-
     public T connect(final URI remote, final URI local, final IoHandler handler) throws Exception
{
         assert remote != null;
         assert handler != null;
         // local can be null
 
         T transport = createTransport();
-        transport.getConfiguration().setHandler(handler);
+        transport.setHandler(handler);
         transport.connect(remote, local);
 
         return transport;
@@ -98,23 +86,12 @@
         return (S)container.getBean(scheme + "TransportServer", TransportServer.class);
     }
 
-    public S bind(final URI location, final BaseConfiguration config) throws Exception {
-        assert location != null;
-        assert config != null;
-
-        S server = createTransportServer();
-        server.setConfiguration(config);
-        server.bind(location);
-
-        return server;
-    }
-
     public S bind(final URI location, final IoHandler handler) throws Exception {
         assert location != null;
         assert handler != null;
 
         S server = createTransportServer();
-        server.getConfiguration().setHandler(handler);
+        server.setHandler(handler);
         server.bind(location);
 
         return server;

Modified: geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportFactory.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportFactory.java?rev=707967&r1=707966&r2=707967&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportFactory.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportFactory.java
Sun Oct 26 03:47:12 2008
@@ -27,7 +27,7 @@
  * @version $Rev$ $Date$
  */
 public class SslTransportFactory
-    extends TcpTransportFactory<SslTransport, SslTransportServer>
+    extends TcpTransportFactory
 {
     public static final String SCHEME = "ssl";
 

Modified: geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportFactory.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportFactory.java?rev=707967&r1=707966&r2=707967&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportFactory.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportFactory.java
Sun Oct 26 03:47:12 2008
@@ -26,7 +26,7 @@
  *
  * @version $Rev$ $Date$
  */
-public class TcpTransportFactory<T extends TcpTransport, S extends TcpTransportServer>
+public class TcpTransportFactory
     extends BaseTransportFactory
 {
     public static final String SCHEME = "tcp";

Modified: geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportFactoryTest.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportFactoryTest.java?rev=707967&r1=707966&r2=707967&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportFactoryTest.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportFactoryTest.java
Sun Oct 26 03:47:12 2008
@@ -23,7 +23,6 @@
 import org.apache.geronimo.gshell.whisper.transport.TransportFactory;
 import org.apache.geronimo.gshell.whisper.transport.TransportFactoryLocator;
 import org.apache.geronimo.gshell.whisper.transport.TransportServer;
-import org.apache.geronimo.gshell.whisper.transport.base.BaseConfiguration;
 import org.apache.mina.common.IoHandlerAdapter;
 
 import java.net.URI;
@@ -57,19 +56,6 @@
         assertNotNull(factory);
     }
 
-    public void testBindWithConfig() throws Exception {
-        BaseConfiguration config = new BaseConfiguration();
-        config.setHandler(new IoHandlerAdapter());
-
-        TransportServer server = factory.bind(uri, config);
-        
-        assertNotNull(server);
-        
-        assertTrue(server instanceof VmTransportServer);
-
-        server.close();
-    }
-
     public void testBindWithHandler() throws Exception {
         TransportServer server = factory.bind(uri, new IoHandlerAdapter());
 



Mime
View raw message