Author: markt
Date: Fri Apr 19 19:48:59 2013
New Revision: 1470008
URL: http://svn.apache.org/r1470008
Log:
Align API with spec. Update tests for new API.
Modified:
tomcat/trunk/java/javax/websocket/ClientEndpointConfig.java
tomcat/trunk/java/javax/websocket/Decoder.java
tomcat/trunk/java/javax/websocket/Encoder.java
tomcat/trunk/java/javax/websocket/server/ServerEndpointConfig.java
tomcat/trunk/test/org/apache/tomcat/websocket/TestUtil.java
tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
Modified: tomcat/trunk/java/javax/websocket/ClientEndpointConfig.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/ClientEndpointConfig.java?rev=1470008&r1=1470007&r2=1470008&view=diff
==============================================================================
--- tomcat/trunk/java/javax/websocket/ClientEndpointConfig.java (original)
+++ tomcat/trunk/java/javax/websocket/ClientEndpointConfig.java Fri Apr 19
19:48:59 2013
@@ -113,7 +113,7 @@ public interface ClientEndpointConfig ex
}
- public abstract class Configurator {
+ public class Configurator {
/**
* Provides the client with a mechanism to inspect and/or modify the
headers
Modified: tomcat/trunk/java/javax/websocket/Decoder.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/Decoder.java?rev=1470008&r1=1470007&r2=1470008&view=diff
==============================================================================
--- tomcat/trunk/java/javax/websocket/Decoder.java (original)
+++ tomcat/trunk/java/javax/websocket/Decoder.java Fri Apr 19 19:48:59 2013
@@ -27,19 +27,6 @@ public interface Decoder {
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=1470008&r1=1470007&r2=1470008&view=diff
==============================================================================
--- tomcat/trunk/java/javax/websocket/Encoder.java (original)
+++ tomcat/trunk/java/javax/websocket/Encoder.java Fri Apr 19 19:48:59 2013
@@ -27,19 +27,6 @@ public interface Encoder {
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/java/javax/websocket/server/ServerEndpointConfig.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/server/ServerEndpointConfig.java?rev=1470008&r1=1470007&r2=1470008&view=diff
==============================================================================
--- tomcat/trunk/java/javax/websocket/server/ServerEndpointConfig.java
(original)
+++ tomcat/trunk/java/javax/websocket/server/ServerEndpointConfig.java Fri Apr
19 19:48:59 2013
@@ -134,7 +134,7 @@ public interface ServerEndpointConfig ex
}
- public abstract class Configurator {
+ public class Configurator {
private static volatile Configurator defaultImpl = null;
private static final Object defaultImplLock = new Object();
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=1470008&r1=1470007&r2=1470008&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/websocket/TestUtil.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/websocket/TestUtil.java Fri Apr 19
19:48:59 2013
@@ -18,6 +18,7 @@ package org.apache.tomcat.websocket;
import javax.websocket.EncodeException;
import javax.websocket.Encoder;
+import javax.websocket.EndpointConfig;
import javax.websocket.MessageHandler;
import org.junit.Assert;
@@ -173,8 +174,17 @@ public class TestUtil {
}
- private static class SimpleEncoder extends Encoder.Adapter
- implements Encoder.Text<String> {
+ private static class SimpleEncoder implements Encoder.Text<String> {
+
+ @Override
+ public void init(EndpointConfig endpointConfig) {
+ // NO-OP
+ }
+
+ @Override
+ public void destroy() {
+ // NO-OP
+ }
@Override
public String encode(String object) throws EncodeException {
@@ -187,8 +197,17 @@ public class TestUtil {
}
- private abstract static class GenericEncoder<T> extends Encoder.Adapter
- implements Encoder.Text<T> {
+ private abstract static class GenericEncoder<T> implements Encoder.Text<T>
{
+
+ @Override
+ public void init(EndpointConfig endpointConfig) {
+ // NO-OP
+ }
+
+ @Override
+ public void destroy() {
+ // NO-OP
+ }
}
@@ -204,7 +223,17 @@ public class TestUtil {
private abstract static class GenericMultipleEncoder<A,B>
- extends Encoder.Adapter implements Encoder.Text<A>, Foo<B> {
+ implements Encoder.Text<A>, Foo<B> {
+
+ @Override
+ public void init(EndpointConfig endpointConfig) {
+ // NO-OP
+ }
+
+ @Override
+ public void destroy() {
+ // NO-OP
+ }
}
Modified:
tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java?rev=1470008&r1=1470007&r2=1470008&view=diff
==============================================================================
---
tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
(original)
+++
tomcat/trunk/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
Fri Apr 19 19:48:59 2013
@@ -27,6 +27,7 @@ import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.EncodeException;
import javax.websocket.Encoder;
+import javax.websocket.EndpointConfig;
import javax.websocket.OnMessage;
import javax.websocket.Session;
import javax.websocket.WebSocketContainer;
@@ -144,8 +145,17 @@ public class TestEncodingDecoding extend
}
- public static class MsgStringEncoder extends Encoder.Adapter
- implements Encoder.Text<MsgString> {
+ public static class MsgStringEncoder implements Encoder.Text<MsgString> {
+
+ @Override
+ public void init(EndpointConfig endpointConfig) {
+ // NO-OP
+ }
+
+ @Override
+ public void destroy() {
+ // NO-OP
+ }
@Override
public String encode(MsgString msg) throws EncodeException {
@@ -154,8 +164,17 @@ public class TestEncodingDecoding extend
}
- public static class MsgStringDecoder extends Decoder.Adapter
- implements Decoder.Text<MsgString> {
+ public static class MsgStringDecoder implements Decoder.Text<MsgString> {
+
+ @Override
+ public void init(EndpointConfig endpointConfig) {
+ // NO-OP
+ }
+
+ @Override
+ public void destroy() {
+ // NO-OP
+ }
@Override
public MsgString decode(String s) throws DecodeException {
@@ -179,8 +198,17 @@ public class TestEncodingDecoding extend
}
- public static class MsgByteEncoder extends Encoder.Adapter
- implements Encoder.Binary<MsgByte> {
+ public static class MsgByteEncoder implements Encoder.Binary<MsgByte> {
+
+ @Override
+ public void init(EndpointConfig endpointConfig) {
+ // NO-OP
+ }
+
+ @Override
+ public void destroy() {
+ // NO-OP
+ }
@Override
public ByteBuffer encode(MsgByte msg) throws EncodeException {
@@ -194,8 +222,17 @@ public class TestEncodingDecoding extend
}
- public static class MsgByteDecoder extends Decoder.Adapter
- implements Decoder.Binary<MsgByte> {
+ public static class MsgByteDecoder implements Decoder.Binary<MsgByte> {
+
+ @Override
+ public void init(EndpointConfig endpointConfig) {
+ // NO-OP
+ }
+
+ @Override
+ public void destroy() {
+ // NO-OP
+ }
@Override
public MsgByte decode(ByteBuffer bb) throws DecodeException {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]