tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1452866 - in /tomcat/trunk: java/javax/websocket/Decoder.java java/javax/websocket/Encoder.java test/org/apache/tomcat/websocket/TestUtil.java
Date Tue, 05 Mar 2013 15:55:26 GMT
Author: markt
Date: Tue Mar  5 15:55:26 2013
New Revision: 1452866

URL: http://svn.apache.org/r1452866
Log:
Refactoring towards v014 API (not yet complete)

Modified:
    tomcat/trunk/java/javax/websocket/Decoder.java
    tomcat/trunk/java/javax/websocket/Encoder.java
    tomcat/trunk/test/org/apache/tomcat/websocket/TestUtil.java

Modified: tomcat/trunk/java/javax/websocket/Decoder.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/Decoder.java?rev=1452866&r1=1452865&r2=1452866&view=diff
==============================================================================
--- tomcat/trunk/java/javax/websocket/Decoder.java (original)
+++ tomcat/trunk/java/javax/websocket/Decoder.java Tue Mar  5 15:55:26 2013
@@ -23,6 +23,23 @@ import java.nio.ByteBuffer;
 
 public interface Decoder {
 
+    abstract void init(EndpointConfig endpointConfig);
+
+    abstract void destroy();
+
+    abstract class Adapter implements Decoder {
+
+        @Override
+        public void init(EndpointConfig endpointConfig) {
+            // NO-OP
+        }
+
+        @Override
+        public void destroy() {
+            // NO_OP
+        }
+    }
+
     interface Binary<T> extends Decoder {
 
         T decode(ByteBuffer bytes) throws DecodeException;

Modified: tomcat/trunk/java/javax/websocket/Encoder.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/Encoder.java?rev=1452866&r1=1452865&r2=1452866&view=diff
==============================================================================
--- tomcat/trunk/java/javax/websocket/Encoder.java (original)
+++ tomcat/trunk/java/javax/websocket/Encoder.java Tue Mar  5 15:55:26 2013
@@ -23,6 +23,23 @@ import java.nio.ByteBuffer;
 
 public interface Encoder {
 
+    abstract void init(EndpointConfig endpointConfig);
+
+    abstract void destroy();
+
+    abstract class Adapter implements Encoder {
+
+        @Override
+        public void init(EndpointConfig endpointConfig) {
+            // NO-OP
+        }
+
+        @Override
+        public void destroy() {
+            // NO_OP
+        }
+    }
+
     interface Text<T> extends Encoder {
 
         String encode(T object) throws EncodeException;

Modified: tomcat/trunk/test/org/apache/tomcat/websocket/TestUtil.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/TestUtil.java?rev=1452866&r1=1452865&r2=1452866&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/websocket/TestUtil.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/websocket/TestUtil.java Tue Mar  5 15:55:26 2013
@@ -173,7 +173,7 @@ public class TestUtil {
     }
 
 
-    private static class SimpleEncoder
+    private static class SimpleEncoder extends Encoder.Adapter
             implements Encoder.Text<String> {
 
         @Override
@@ -187,7 +187,7 @@ public class TestUtil {
     }
 
 
-    private abstract static class GenericEncoder<T>
+    private abstract static class GenericEncoder<T> extends Encoder.Adapter
             implements Encoder.Text<T> {
     }
 
@@ -204,7 +204,7 @@ public class TestUtil {
 
 
     private abstract static class GenericMultipleEncoder<A,B>
-            implements Encoder.Text<A>, Foo<B> {
+            extends Encoder.Adapter implements Encoder.Text<A>, Foo<B> {
     }
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message