geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r576617 - in /geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport: ssl/ tcp/
Date Mon, 17 Sep 2007 22:44:39 GMT
Author: jdillon
Date: Mon Sep 17 15:44:37 2007
New Revision: 576617

URL: http://svn.apache.org/viewvc?rev=576617&view=rev
Log:
Update some javadoc, use common visitor support to hold the common bits

Added:
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpMessageVisitorSupport.java
      - copied, changed from r576615, geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpClientMessageVisitor.java
Modified:
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/ssl/package-info.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpClientMessageVisitor.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpServerMessageVisitor.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/package-info.java

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/ssl/package-info.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/ssl/package-info.java?rev=576617&r1=576616&r2=576617&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/ssl/package-info.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/ssl/package-info.java
Mon Sep 17 15:44:37 2007
@@ -18,7 +18,7 @@
  */
 
 /**
- * ???
+ * Support for connections over TCP+SSL.
  *
  * @version $Rev$ $Date$
  */

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpClientMessageVisitor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpClientMessageVisitor.java?rev=576617&r1=576616&r2=576617&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpClientMessageVisitor.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpClientMessageVisitor.java
Mon Sep 17 15:44:37 2007
@@ -36,36 +36,11 @@
  */
 @Component(role=TcpClientMessageVisitor.class)
 public class TcpClientMessageVisitor
-    extends MessageVisitorAdapter
+    extends TcpMessageVisitorSupport
 {
-    private Logger log = LoggerFactory.getLogger(getClass());
-
     public void visitEcho(final EchoMessage msg) {
         assert msg != null;
 
         log.info("ECHO: {}", msg.getText());
-    }
-
-    public void visitWriteStream(final WriteStreamMessage msg) {
-        assert msg != null;
-
-        IoSession session = (IoSession) msg.getAttachment();
-        assert session != null;
-
-        // Look up the bound stream in the session context
-        String key = Transport.STREAM_BASENAME + msg.getName();
-        Object stream = session.getAttribute(key);
-
-        // For now lets not toss any exceptions or send back any fault messages
-        if (stream == null) {
-            log.error("Stream is not registered: {}", key);
-        }
-        else if (!(stream instanceof IoSessionInputStream)) {
-            log.error("Stream is not for input: {}", key);
-        }
-        else {
-            IoSessionInputStream in = (IoSessionInputStream)stream;
-            in.write(msg.getBuffer());
-        }
     }
 }

Copied: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpMessageVisitorSupport.java
(from r576615, geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpClientMessageVisitor.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpMessageVisitorSupport.java?p2=geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpMessageVisitorSupport.java&p1=geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpClientMessageVisitor.java&r1=576615&r2=576617&rev=576617&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpClientMessageVisitor.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpMessageVisitorSupport.java
Mon Sep 17 15:44:37 2007
@@ -34,17 +34,10 @@
  *
  * @version $Rev$ $Date$
  */
-@Component(role=TcpClientMessageVisitor.class)
-public class TcpClientMessageVisitor
+public abstract class TcpMessageVisitorSupport
     extends MessageVisitorAdapter
 {
-    private Logger log = LoggerFactory.getLogger(getClass());
-
-    public void visitEcho(final EchoMessage msg) {
-        assert msg != null;
-
-        log.info("ECHO: {}", msg.getText());
-    }
+    protected Logger log = LoggerFactory.getLogger(getClass());
 
     public void visitWriteStream(final WriteStreamMessage msg) {
         assert msg != null;

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpServerMessageVisitor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpServerMessageVisitor.java?rev=576617&r1=576616&r2=576617&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpServerMessageVisitor.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/TcpServerMessageVisitor.java
Mon Sep 17 15:44:37 2007
@@ -45,10 +45,8 @@
  */
 @Component(role=TcpServerMessageVisitor.class)
 public class TcpServerMessageVisitor
-    extends MessageVisitorAdapter
+    extends TcpMessageVisitorSupport
 {
-    private Logger log = LoggerFactory.getLogger(getClass());
-
     public void visitEcho(final EchoMessage msg) {
         assert msg != null;
 
@@ -128,29 +126,5 @@
         resp.setId(msg.getId());
 
         session.write(resp);
-    }
-
-    public void visitWriteStream(final WriteStreamMessage msg) {
-        assert msg != null;
-
-        IoSession session = (IoSession) msg.getAttachment();
-        assert session != null;
-
-        // Look up the bound stream in the session context
-        String key = Transport.STREAM_BASENAME + msg.getName();
-        Object stream = session.getAttribute(key);
-
-        // For now lets not toss any exceptions or send back any fault messages
-        if (stream == null) {
-            log.error("Stream is not registered: {}", key);
-        }
-        else if (!(stream instanceof IoSessionInputStream)) {
-            log.error("Stream is not for input: {}", key);
-        }
-        else {
-            IoSessionInputStream in = (IoSessionInputStream)stream;
-            ByteBuffer buff = msg.getBuffer();
-            in.write(buff);
-        }
     }
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/package-info.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/package-info.java?rev=576617&r1=576616&r2=576617&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/package-info.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/tcp/package-info.java
Mon Sep 17 15:44:37 2007
@@ -18,7 +18,7 @@
  */
 
 /**
- * ???
+ * Support for connections over TCP.
  *
  * @version $Rev$ $Date$
  */



Mime
View raw message