directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r109298 - in incubator/directory/seda/branches/trustin: . src src/java src/java/org src/java/org/apache src/java/org/apache/netty src/java/org/apache/netty/common src/java/org/apache/netty/downstream src/java/org/apache/netty/registry src/java/org/apache/netty/upstream src/test xdocs
Date Wed, 01 Dec 2004 06:07:24 GMT
Author: trustin
Date: Tue Nov 30 22:07:22 2004
New Revision: 109298

URL: http://svn.apache.org/viewcvs?view=rev&rev=109298
Log:
Import of the revamped SEDA API (or Netty 2.0 ;)
An example and documentation will come sooner or later.


Added:
   incubator/directory/seda/branches/trustin/maven.xml
      - copied, changed from r109267, incubator/directory/seda/trunk/maven.xml
   incubator/directory/seda/branches/trustin/project.properties
      - copied unchanged from r109267, incubator/directory/seda/trunk/project.properties
   incubator/directory/seda/branches/trustin/project.xml
      - copied, changed from r109267, incubator/directory/seda/trunk/project.xml
   incubator/directory/seda/branches/trustin/src/
   incubator/directory/seda/branches/trustin/src/java/
   incubator/directory/seda/branches/trustin/src/java/org/
   incubator/directory/seda/branches/trustin/src/java/org/apache/
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/common/
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/common/IdleStatus.java
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/common/IntraVmAddress.java
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/Acceptor.java
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/Connector.java
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/Session.java
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/SessionHandler.java
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/registry/
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Acceptor.java
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Codec.java
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Connector.java
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Session.java
   incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/SessionHandler.java
   incubator/directory/seda/branches/trustin/src/test/
   incubator/directory/seda/branches/trustin/xdocs/
      - copied from r109267, incubator/directory/seda/trunk/xdocs/
Removed:
   incubator/directory/seda/branches/trustin/xdocs/router-changes.xml

Copied: incubator/directory/seda/branches/trustin/maven.xml (from r109267, incubator/directory/seda/trunk/maven.xml)
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/branches/trustin/maven.xml?view=diff&rev=109298&p1=incubator/directory/seda/trunk/maven.xml&r1=109267&p2=incubator/directory/seda/branches/trustin/maven.xml&r2=109298
==============================================================================
--- incubator/directory/seda/trunk/maven.xml	(original)
+++ incubator/directory/seda/branches/trustin/maven.xml	Tue Nov 30 22:07:22 2004
@@ -1,6 +1,7 @@
 <project default="test"
   xmlns:ant="jelly:ant" xmlns:maven="jelly:maven">
 
+  <!--
   <preGoal name="java:compile">
     <ant:path
       id="my.other.src.dir"
@@ -9,5 +10,6 @@
       id="maven.compile.src.set"
       refid="my.other.src.dir"/>
   </preGoal>
+  -->
 
-</project>
\ No newline at end of file
+</project>

Copied: incubator/directory/seda/branches/trustin/project.properties (from r109267, incubator/directory/seda/trunk/project.properties)
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/branches/trustin/project.properties?view=diff&rev=109298&p1=incubator/directory/seda/trunk/project.properties&r1=109267&p2=incubator/directory/seda/branches/trustin/project.properties&r2=109298
==============================================================================

Copied: incubator/directory/seda/branches/trustin/project.xml (from r109267, incubator/directory/seda/trunk/project.xml)
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/branches/trustin/project.xml?view=diff&rev=109298&p1=incubator/directory/seda/trunk/project.xml&r1=109267&p2=incubator/directory/seda/branches/trustin/project.xml&r2=109298
==============================================================================
--- incubator/directory/seda/trunk/project.xml	(original)
+++ incubator/directory/seda/branches/trustin/project.xml	Tue Nov 30 22:07:22 2004
@@ -2,9 +2,9 @@
 <project>
 
   <groupId>incubator-directory</groupId>
-  <id>seda</id>
-  <name>seda</name>
-  <package>org.apache.seda</package>
+  <id>netty</id>
+  <name>netty</name>
+  <package>org.apache.netty</package>
   <currentVersion>SNAPSHOT</currentVersion>
   <inceptionYear>2004</inceptionYear>
 
@@ -15,7 +15,6 @@
   </organization>
 
   <inceptionYear>2003</inceptionYear>
-  <package>org.apache.seda</package>
 
   <logo>/images/apache-directory-logo.png</logo>
   <url>http://incubator.apache.org/directory</url>
@@ -98,6 +97,13 @@
     <!-- ================================ -->
     <!-- CORE Dependencies needed for use -->
     <!-- ================================ -->
+
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.0</version>
+      <url>http://jakarta.apache.org/commons/lang</url>
+    </dependency>
 
     <dependency>
       <groupId>commons-logging</groupId>

Added: incubator/directory/seda/branches/trustin/src/java/org/apache/netty/common/IdleStatus.java
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/branches/trustin/src/java/org/apache/netty/common/IdleStatus.java?view=auto&rev=109298
==============================================================================
--- (empty file)
+++ incubator/directory/seda/branches/trustin/src/java/org/apache/netty/common/IdleStatus.java
Tue Nov 30 22:07:22 2004
@@ -0,0 +1,30 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.netty.common;
+
+/**
+ * TODO Insert type comment.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public class IdleStatus {
+    public static final IdleStatus NOT_IDLE = new IdleStatus("not idle");
+    public static final IdleStatus READER_IDLE = new IdleStatus("reader idle");
+    public static final IdleStatus WRITER_IDLE = new IdleStatus("writer idle");
+    public static final IdleStatus BOTH_IDLE = new IdleStatus("both idle");
+
+    private final String strValue;
+
+    /**
+     * Creates a new instance.
+     */
+    private IdleStatus(String strValue) {
+        this.strValue = strValue;
+    }
+    
+    public String toString() {
+        return strValue;
+    }
+}

Added: incubator/directory/seda/branches/trustin/src/java/org/apache/netty/common/IntraVmAddress.java
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/branches/trustin/src/java/org/apache/netty/common/IntraVmAddress.java?view=auto&rev=109298
==============================================================================
--- (empty file)
+++ incubator/directory/seda/branches/trustin/src/java/org/apache/netty/common/IntraVmAddress.java
Tue Nov 30 22:07:22 2004
@@ -0,0 +1,47 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.netty.common;
+
+import java.net.SocketAddress;
+
+import org.apache.commons.lang.Validate;
+
+/**
+ * TODO Insert type comment.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public class IntraVmAddress extends SocketAddress {
+
+    private final String port;
+
+    /**
+     * Creates a new instance.
+     */
+    public IntraVmAddress(String port) {
+        Validate.notNull(port);
+        this.port = port;
+    }
+
+    public String getPort() {
+        return port;
+    }
+    
+    public int hashCode() {
+        return port.hashCode();
+    }
+    
+    public boolean equals(Object o) {
+        if (o == null)
+            return false;
+        if (this == o)
+            return true;
+        if (o instanceof IntraVmAddress) {
+            return port.equals(((IntraVmAddress) o).getPort());
+        }
+        
+        return false;
+    }
+}

Added: incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/Acceptor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/Acceptor.java?view=auto&rev=109298
==============================================================================
--- (empty file)
+++ incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/Acceptor.java
Tue Nov 30 22:07:22 2004
@@ -0,0 +1,18 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.netty.downstream;
+
+import java.io.IOException;
+import java.net.SocketAddress;
+
+/**
+ * TODO Insert type comment.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface Acceptor {
+    void bind(SocketAddress address, SessionHandler defaultHandler) throws IOException;
+    void unbind(SocketAddress address);
+}

Added: incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/Connector.java
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/Connector.java?view=auto&rev=109298
==============================================================================
--- (empty file)
+++ incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/Connector.java
Tue Nov 30 22:07:22 2004
@@ -0,0 +1,15 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.netty.downstream;
+
+
+/**
+ * TODO Insert type comment.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface Connector {
+    void connect(Session session, SessionHandler defaultHandler);
+}

Added: incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/Session.java
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/Session.java?view=auto&rev=109298
==============================================================================
--- (empty file)
+++ incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/Session.java
Tue Nov 30 22:07:22 2004
@@ -0,0 +1,37 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.netty.downstream;
+
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+
+/**
+ * TODO Insert type comment.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface Session {
+    SessionHandler getHandler();
+    void setHandler(SessionHandler handler);
+    
+    void close();
+    
+    ByteBuffer getWriteBuffer();
+    void setMark(Object mark);
+    void flush();
+
+    boolean isConnected();
+    boolean isClosed();
+    
+    SocketAddress getRemoteAddress();
+    SocketAddress getLocalAddress();
+    
+    long getReadBytes();
+    long getWrittenBytes();
+
+    long getLastIoTime();
+    long getLastReadTime();
+    long getLastWriteTime();
+}

Added: incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/SessionHandler.java
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/SessionHandler.java?view=auto&rev=109298
==============================================================================
--- (empty file)
+++ incubator/directory/seda/branches/trustin/src/java/org/apache/netty/downstream/SessionHandler.java
Tue Nov 30 22:07:22 2004
@@ -0,0 +1,23 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.netty.downstream;
+
+import java.nio.ByteBuffer;
+
+import org.apache.netty.common.IdleStatus;
+
+/**
+ * TODO Insert type comment.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface SessionHandler {
+    void sessionEstablished(Session session);
+    void sessionClosed(Session session);
+    void sessionIdle(Session session, IdleStatus status);
+    void exceptionCaught(Session session, Throwable cause);
+    void dataRead(Session session, ByteBuffer buf);
+    void markRemoved(Session session, Object mark);
+}

Added: incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Acceptor.java
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Acceptor.java?view=auto&rev=109298
==============================================================================
--- (empty file)
+++ incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Acceptor.java
Tue Nov 30 22:07:22 2004
@@ -0,0 +1,18 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.netty.upstream;
+
+import java.io.IOException;
+import java.net.SocketAddress;
+
+/**
+ * TODO Insert type comment.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface Acceptor {
+    void bind(SocketAddress address, SessionHandler defaultHandler) throws IOException;
+    void unbind(SocketAddress address);
+}

Added: incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Codec.java
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Codec.java?view=auto&rev=109298
==============================================================================
--- (empty file)
+++ incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Codec.java
Tue Nov 30 22:07:22 2004
@@ -0,0 +1,18 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.netty.upstream;
+
+import org.apache.commons.codec.stateful.StatefulDecoder;
+import org.apache.commons.codec.stateful.StatefulEncoder;
+
+/**
+ * TODO Insert type comment.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface Codec {
+    StatefulEncoder newEncoder(Session session);
+    StatefulDecoder newDecoder(Session session);
+}

Added: incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Connector.java
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Connector.java?view=auto&rev=109298
==============================================================================
--- (empty file)
+++ incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Connector.java
Tue Nov 30 22:07:22 2004
@@ -0,0 +1,16 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.netty.upstream;
+
+import java.net.SocketAddress;
+
+/**
+ * TODO Insert type comment.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface Connector {
+    void connect(SocketAddress address, SessionHandler defaultHandler);
+}

Added: incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Session.java
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Session.java?view=auto&rev=109298
==============================================================================
--- (empty file)
+++ incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/Session.java
Tue Nov 30 22:07:22 2004
@@ -0,0 +1,34 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.netty.upstream;
+
+import java.net.SocketAddress;
+
+/**
+ * TODO Insert type comment.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface Session {
+    void addHandler(SessionHandler handler);
+    void removeHandler(SessionHandler handler);
+    
+    Codec getCodec();
+    void setCodec(Codec codec);
+
+    void close();
+    
+    boolean write(Object message);
+    
+    boolean isConnected();
+    boolean isClosed();
+    
+    SocketAddress getRemoteAddress();
+    SocketAddress getLocalAddress();
+    
+    long getLastIoTime();
+    long getLastReadTime();
+    long getLastWriteTime();
+}

Added: incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/SessionHandler.java
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/SessionHandler.java?view=auto&rev=109298
==============================================================================
--- (empty file)
+++ incubator/directory/seda/branches/trustin/src/java/org/apache/netty/upstream/SessionHandler.java
Tue Nov 30 22:07:22 2004
@@ -0,0 +1,21 @@
+/*
+ * @(#) $Id$
+ */
+package org.apache.netty.upstream;
+
+import org.apache.netty.common.IdleStatus;
+
+/**
+ * TODO Insert type comment.
+ * 
+ * @author Trustin Lee (trustin@apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface SessionHandler {
+    void sessionEstablished(Session session);
+    void sessionClosed(Session session);
+    void sessionIdle(Session session, IdleStatus status);
+    void exceptionCaught(Session session, Throwable cause);
+    void messageReceived(Session session, Object message);
+    void messageSent(Session session, Object message);
+}

Deleted: /incubator/directory/seda/trunk/xdocs/router-changes.xml
Url: http://svn.apache.org/viewcvs/incubator/directory/seda/trunk/xdocs/router-changes.xml?view=auto&rev=109267
==============================================================================

Mime
View raw message