Author: markt Date: Wed Nov 21 20:20:40 2012 New Revision: 1412268 URL: http://svn.apache.org/viewvc?rev=1412268&view=rev Log: Update to latest WebSocket API proposal Checked against reference implementation with javap
Added: tomcat/trunk/java/javax/websocket/ tomcat/trunk/java/javax/websocket/ClientContainer.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/ClientContainer.java tomcat/trunk/java/javax/websocket/ClientEndpointConfiguration.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/ClientEndpointConfiguration.java tomcat/trunk/java/javax/websocket/CloseReason.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/CloseReason.java tomcat/trunk/java/javax/websocket/ContainerProvider.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/ContainerProvider.java tomcat/trunk/java/javax/websocket/DecodeException.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/DecodeException.java tomcat/trunk/java/javax/websocket/Decoder.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/Decoder.java tomcat/trunk/java/javax/websocket/DefaultClientConfiguration.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/DefaultClientConfiguration.java tomcat/trunk/java/javax/websocket/DefaultServerConfiguration.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/DefaultServerConfiguration.java tomcat/trunk/java/javax/websocket/DeploymentException.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/extensions/FrameHandler.java tomcat/trunk/java/javax/websocket/EncodeException.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/EncodeException.java tomcat/trunk/java/javax/websocket/Encoder.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/Encoder.java tomcat/trunk/java/javax/websocket/Endpoint.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/Endpoint.java tomcat/trunk/java/javax/websocket/EndpointConfiguration.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/EndpointConfiguration.java tomcat/trunk/java/javax/websocket/HandshakeRequest.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/HandshakeRequest.java tomcat/trunk/java/javax/websocket/HandshakeResponse.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/HandshakeResponse.java tomcat/trunk/java/javax/websocket/MessageHandler.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/ContainerProvider.java tomcat/trunk/java/javax/websocket/PingMessage.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/SendHandler.java tomcat/trunk/java/javax/websocket/RemoteEndpoint.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/RemoteEndpoint.java tomcat/trunk/java/javax/websocket/SendHandler.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/SendHandler.java tomcat/trunk/java/javax/websocket/SendResult.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/SendResult.java tomcat/trunk/java/javax/websocket/ServerContainer.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/ServerContainer.java tomcat/trunk/java/javax/websocket/ServerEndpointConfiguration.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/ServerEndpointConfiguration.java tomcat/trunk/java/javax/websocket/Session.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/Session.java tomcat/trunk/java/javax/websocket/WebSocketClient.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/annotations/WebSocketClose.java tomcat/trunk/java/javax/websocket/WebSocketClose.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/annotations/WebSocketClose.java tomcat/trunk/java/javax/websocket/WebSocketEndpoint.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/annotations/WebSocketEndpoint.java tomcat/trunk/java/javax/websocket/WebSocketError.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/annotations/WebSocketError.java tomcat/trunk/java/javax/websocket/WebSocketMessage.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/annotations/WebSocketMessage.java tomcat/trunk/java/javax/websocket/WebSocketOpen.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/annotations/WebSocketOpen.java tomcat/trunk/java/javax/websocket/WebSocketPathParam.java - copied, changed from r1411993, tomcat/trunk/java/javax/net/websocket/annotations/WebSocketPathParam.java Removed: tomcat/trunk/java/javax/net/websocket/ClientContainer.java tomcat/trunk/java/javax/net/websocket/ClientEndpointConfiguration.java tomcat/trunk/java/javax/net/websocket/CloseReason.java tomcat/trunk/java/javax/net/websocket/ContainerProvider.java tomcat/trunk/java/javax/net/websocket/DecodeException.java tomcat/trunk/java/javax/net/websocket/Decoder.java tomcat/trunk/java/javax/net/websocket/DefaultClientConfiguration.java tomcat/trunk/java/javax/net/websocket/DefaultServerConfiguration.java tomcat/trunk/java/javax/net/websocket/EncodeException.java tomcat/trunk/java/javax/net/websocket/Encoder.java tomcat/trunk/java/javax/net/websocket/Endpoint.java tomcat/trunk/java/javax/net/websocket/EndpointConfiguration.java tomcat/trunk/java/javax/net/websocket/HandshakeRequest.java tomcat/trunk/java/javax/net/websocket/HandshakeResponse.java tomcat/trunk/java/javax/net/websocket/MessageHandler.java tomcat/trunk/java/javax/net/websocket/RemoteEndpoint.java tomcat/trunk/java/javax/net/websocket/SendHandler.java tomcat/trunk/java/javax/net/websocket/SendResult.java tomcat/trunk/java/javax/net/websocket/ServerContainer.java tomcat/trunk/java/javax/net/websocket/ServerEndpointConfiguration.java tomcat/trunk/java/javax/net/websocket/Session.java tomcat/trunk/java/javax/net/websocket/annotations/WebSocketClose.java tomcat/trunk/java/javax/net/websocket/annotations/WebSocketEndpoint.java tomcat/trunk/java/javax/net/websocket/annotations/WebSocketError.java tomcat/trunk/java/javax/net/websocket/annotations/WebSocketMessage.java tomcat/trunk/java/javax/net/websocket/annotations/WebSocketOpen.java tomcat/trunk/java/javax/net/websocket/annotations/WebSocketPathParam.java tomcat/trunk/java/javax/net/websocket/extensions/Extension.java tomcat/trunk/java/javax/net/websocket/extensions/Frame.java tomcat/trunk/java/javax/net/websocket/extensions/FrameBuilder.java tomcat/trunk/java/javax/net/websocket/extensions/FrameHandler.java Modified: tomcat/trunk/res/checkstyle/javax-import-control.xml Copied: tomcat/trunk/java/javax/websocket/ClientContainer.java (from r1411993, tomcat/trunk/java/javax/net/websocket/ClientContainer.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/ClientContainer.java?p2=tomcat/trunk/java/javax/websocket/ClientContainer.java&p1=tomcat/trunk/java/javax/net/websocket/ClientContainer.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/ClientContainer.java (original) +++ tomcat/trunk/java/javax/websocket/ClientContainer.java Wed Nov 21 20:20:40 2012 @@ -14,17 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; +import java.net.URI; import java.util.Set; -import javax.net.websocket.extensions.Extension; - public interface ClientContainer { - void connectToServer(Endpoint endpoint, ClientEndpointConfiguration olc); + void connectToServer(Object endpoint, URI path) throws DeploymentException; - Set<Session<?>> getActiveSessions(); + Set<Session> getActiveSessions(); long getMaxSessionIdleTimeout(); @@ -38,5 +37,5 @@ public interface ClientContainer { void setMaxTextMessageBufferSize(long max); - Set<Extension> getInstalledExtensions(); + Set<String> getInstalledExtensions(); } Copied: tomcat/trunk/java/javax/websocket/ClientEndpointConfiguration.java (from r1411993, tomcat/trunk/java/javax/net/websocket/ClientEndpointConfiguration.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/ClientEndpointConfiguration.java?p2=tomcat/trunk/java/javax/websocket/ClientEndpointConfiguration.java&p1=tomcat/trunk/java/javax/net/websocket/ClientEndpointConfiguration.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/ClientEndpointConfiguration.java (original) +++ tomcat/trunk/java/javax/websocket/ClientEndpointConfiguration.java Wed Nov 21 20:20:40 2012 @@ -14,15 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; import java.util.List; -import javax.net.websocket.extensions.Extension; - public interface ClientEndpointConfiguration extends EndpointConfiguration { List<String> getPreferredSubprotocols(); - List<Extension> getExtensions(); + List<String> getExtensions(); } Copied: tomcat/trunk/java/javax/websocket/CloseReason.java (from r1411993, tomcat/trunk/java/javax/net/websocket/CloseReason.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/CloseReason.java?p2=tomcat/trunk/java/javax/websocket/CloseReason.java&p1=tomcat/trunk/java/javax/net/websocket/CloseReason.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/CloseReason.java (original) +++ tomcat/trunk/java/javax/websocket/CloseReason.java Wed Nov 21 20:20:40 2012 @@ -14,13 +14,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; public class CloseReason { - @SuppressWarnings("unused") + private final CloseCode closeCode; + private final String reasonPhrase; + public CloseReason(CloseReason.CloseCode closeCode, String reasonPhrase) { - // FIXME - These need accessors + this.closeCode = closeCode; + this.reasonPhrase = reasonPhrase; + } + + public CloseCode getCloseCode() { + return closeCode; + } + + public String getReasonPhrase() { + return reasonPhrase; } public interface CloseCode { @@ -41,6 +52,8 @@ public class CloseReason { TOO_BIG(1009), NO_EXTENSION(1010), UNEXPECTED_CONDITION(1011), + SERVICE_RESTART(1012), + TRY_AGAIN_LATER(1013), TLS_HANDSHAKE_FAILURE(1015); private int code; Copied: tomcat/trunk/java/javax/websocket/ContainerProvider.java (from r1411993, tomcat/trunk/java/javax/net/websocket/ContainerProvider.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/ContainerProvider.java?p2=tomcat/trunk/java/javax/websocket/ContainerProvider.java&p1=tomcat/trunk/java/javax/net/websocket/ContainerProvider.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/ContainerProvider.java (original) +++ tomcat/trunk/java/javax/websocket/ContainerProvider.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; public class ContainerProvider { Copied: tomcat/trunk/java/javax/websocket/DecodeException.java (from r1411993, tomcat/trunk/java/javax/net/websocket/DecodeException.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/DecodeException.java?p2=tomcat/trunk/java/javax/websocket/DecodeException.java&p1=tomcat/trunk/java/javax/net/websocket/DecodeException.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/DecodeException.java (original) +++ tomcat/trunk/java/javax/websocket/DecodeException.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; import java.nio.ByteBuffer; Copied: tomcat/trunk/java/javax/websocket/Decoder.java (from r1411993, tomcat/trunk/java/javax/net/websocket/Decoder.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/Decoder.java?p2=tomcat/trunk/java/javax/websocket/Decoder.java&p1=tomcat/trunk/java/javax/net/websocket/Decoder.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/Decoder.java (original) +++ tomcat/trunk/java/javax/websocket/Decoder.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; import java.io.IOException; import java.io.InputStream; Copied: tomcat/trunk/java/javax/websocket/DefaultClientConfiguration.java (from r1411993, tomcat/trunk/java/javax/net/websocket/DefaultClientConfiguration.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/DefaultClientConfiguration.java?p2=tomcat/trunk/java/javax/websocket/DefaultClientConfiguration.java&p1=tomcat/trunk/java/javax/net/websocket/DefaultClientConfiguration.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/DefaultClientConfiguration.java (original) +++ tomcat/trunk/java/javax/websocket/DefaultClientConfiguration.java Wed Nov 21 20:20:40 2012 @@ -14,29 +14,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; -import java.net.URI; import java.util.ArrayList; import java.util.List; -import javax.net.websocket.extensions.Extension; - public class DefaultClientConfiguration implements ClientEndpointConfiguration { - private URI uri; private List<String> preferredSubprotocols = new ArrayList<>(); - private List<Extension> extensions = new ArrayList<>(); + private List<String> extensions = new ArrayList<>(); private List<Encoder> encoders = new ArrayList<>(); private List<Decoder> decoders = new ArrayList<>(); - public DefaultClientConfiguration(URI uri) { - this.uri = uri; - } - - public URI getURI() { - return uri; - } - @Override public List<String> getPreferredSubprotocols() { return preferredSubprotocols; @@ -49,12 +37,12 @@ public class DefaultClientConfiguration } @Override - public List<Extension> getExtensions() { + public List<String> getExtensions() { return extensions; } public ClientEndpointConfiguration setExtensions( - List<Extension> extensions) { + List<String> extensions) { this.extensions = extensions; return this; } Copied: tomcat/trunk/java/javax/websocket/DefaultServerConfiguration.java (from r1411993, tomcat/trunk/java/javax/net/websocket/DefaultServerConfiguration.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/DefaultServerConfiguration.java?p2=tomcat/trunk/java/javax/websocket/DefaultServerConfiguration.java&p1=tomcat/trunk/java/javax/net/websocket/DefaultServerConfiguration.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/DefaultServerConfiguration.java (original) +++ tomcat/trunk/java/javax/websocket/DefaultServerConfiguration.java Wed Nov 21 20:20:40 2012 @@ -14,28 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; import java.net.URI; import java.util.ArrayList; import java.util.List; -import javax.net.websocket.extensions.Extension; - public class DefaultServerConfiguration implements ServerEndpointConfiguration { - private URI uri; + private String path; @SuppressWarnings("unused") // TODO Remove this once implemented private List<String> subprotocols = new ArrayList<>(); @SuppressWarnings("unused") // TODO Remove this once implemented - private List<Extension> extensions = new ArrayList<>(); + private List<String> extensions = new ArrayList<>(); private List<Encoder> encoders = new ArrayList<>(); private List<Decoder> decoders = new ArrayList<>(); protected DefaultServerConfiguration() { } - public DefaultServerConfiguration(URI uri) { - this.uri = uri; + public DefaultServerConfiguration(String path) { + this.path = path; } public DefaultServerConfiguration setEncoders(List<Encoder> encoders) { @@ -55,7 +53,7 @@ public class DefaultServerConfiguration } public DefaultServerConfiguration setExtensions( - List<Extension> extensions) { + List<String> extensions) { this.extensions = extensions; return this; } @@ -73,6 +71,11 @@ public class DefaultServerConfiguration } @Override + public String getPath() { + return path; + } + + @Override public String getNegotiatedSubprotocol(List<String> requestedSubprotocols) { // TODO return null; @@ -80,8 +83,8 @@ public class DefaultServerConfiguration @Override - public List<Extension> getNegotiatedExtensions( - List<Extension> requestedExtensions) { + public List<String> getNegotiatedExtensions( + List<String> requestedExtensions) { // TODO return null; } @@ -94,7 +97,8 @@ public class DefaultServerConfiguration @Override public boolean matchesURI(URI uri) { - return this.uri.equals(uri); + // TODO + return false; } @Override Copied: tomcat/trunk/java/javax/websocket/DeploymentException.java (from r1411993, tomcat/trunk/java/javax/net/websocket/extensions/FrameHandler.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/DeploymentException.java?p2=tomcat/trunk/java/javax/websocket/DeploymentException.java&p1=tomcat/trunk/java/javax/net/websocket/extensions/FrameHandler.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/extensions/FrameHandler.java (original) +++ tomcat/trunk/java/javax/websocket/DeploymentException.java Wed Nov 21 20:20:40 2012 @@ -1,33 +1,32 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.net.websocket.extensions; - -public abstract class FrameHandler { - private FrameHandler nextHandler; - - public FrameHandler(FrameHandler nextHandler) { - this.nextHandler = nextHandler; - } - - public FrameHandler getNextHandler() { - return this.nextHandler; - } - - public void handleFrame(Frame f) { - this.nextHandler.handleFrame(f); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package javax.websocket; + +public class DeploymentException extends Exception { + + private static final long serialVersionUID = 1L; + + public DeploymentException(String message) { + super(message); + // TODO Auto-generated constructor stub + } + + public DeploymentException(String message, Throwable cause) { + super(message, cause); + // TODO Auto-generated constructor stub + } +} Copied: tomcat/trunk/java/javax/websocket/EncodeException.java (from r1411993, tomcat/trunk/java/javax/net/websocket/EncodeException.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/EncodeException.java?p2=tomcat/trunk/java/javax/websocket/EncodeException.java&p1=tomcat/trunk/java/javax/net/websocket/EncodeException.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/EncodeException.java (original) +++ tomcat/trunk/java/javax/websocket/EncodeException.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; public class EncodeException extends Exception { @@ -22,12 +22,12 @@ public class EncodeException extends Exc private Object object; - public EncodeException(String message, Object object) { + public EncodeException(Object object, String message) { super(message); this.object = object; } - public EncodeException(String message, Object object, Throwable cause) { + public EncodeException(Object object, String message, Throwable cause) { super(message, cause); this.object = object; } Copied: tomcat/trunk/java/javax/websocket/Encoder.java (from r1411993, tomcat/trunk/java/javax/net/websocket/Encoder.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/Encoder.java?p2=tomcat/trunk/java/javax/websocket/Encoder.java&p1=tomcat/trunk/java/javax/net/websocket/Encoder.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/Encoder.java (original) +++ tomcat/trunk/java/javax/websocket/Encoder.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; import java.io.IOException; import java.io.OutputStream; Copied: tomcat/trunk/java/javax/websocket/Endpoint.java (from r1411993, tomcat/trunk/java/javax/net/websocket/Endpoint.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/Endpoint.java?p2=tomcat/trunk/java/javax/websocket/Endpoint.java&p1=tomcat/trunk/java/javax/net/websocket/Endpoint.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/Endpoint.java (original) +++ tomcat/trunk/java/javax/websocket/Endpoint.java Wed Nov 21 20:20:40 2012 @@ -14,24 +14,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; public abstract class Endpoint { + public abstract EndpointConfiguration getEndpointConfiguration(); + /** * Event that is triggered when a new session starts. * * @param session The new session. */ - public abstract void onOpen(Session<?> session); + public abstract void onOpen(Session session); /** * Event that is triggered when a session has closed. * - * @param session The session that has closed * @param closeReason Why the session was closed */ - public void onClose(Session<?> session, CloseReason closeReason) { + public void onClose(CloseReason closeReason) { // NO-OP by default } @@ -39,9 +40,8 @@ public abstract class Endpoint { * Event that is triggered when a protocol error occurs. * * @param throwable The exception - * @param session The session that experienced the error */ - public void onError(Throwable throwable, Session<?> session) { + public void onError(Throwable throwable) { // NO-OP by default } } Copied: tomcat/trunk/java/javax/websocket/EndpointConfiguration.java (from r1411993, tomcat/trunk/java/javax/net/websocket/EndpointConfiguration.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/EndpointConfiguration.java?p2=tomcat/trunk/java/javax/websocket/EndpointConfiguration.java&p1=tomcat/trunk/java/javax/net/websocket/EndpointConfiguration.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/EndpointConfiguration.java (original) +++ tomcat/trunk/java/javax/websocket/EndpointConfiguration.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; import java.util.List; Copied: tomcat/trunk/java/javax/websocket/HandshakeRequest.java (from r1411993, tomcat/trunk/java/javax/net/websocket/HandshakeRequest.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/HandshakeRequest.java?p2=tomcat/trunk/java/javax/websocket/HandshakeRequest.java&p1=tomcat/trunk/java/javax/net/websocket/HandshakeRequest.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/HandshakeRequest.java (original) +++ tomcat/trunk/java/javax/websocket/HandshakeRequest.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; import java.net.URI; import java.security.Principal; Copied: tomcat/trunk/java/javax/websocket/HandshakeResponse.java (from r1411993, tomcat/trunk/java/javax/net/websocket/HandshakeResponse.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/HandshakeResponse.java?p2=tomcat/trunk/java/javax/websocket/HandshakeResponse.java&p1=tomcat/trunk/java/javax/net/websocket/HandshakeResponse.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/HandshakeResponse.java (original) +++ tomcat/trunk/java/javax/websocket/HandshakeResponse.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; import java.util.List; import java.util.Map; Copied: tomcat/trunk/java/javax/websocket/MessageHandler.java (from r1411993, tomcat/trunk/java/javax/net/websocket/ContainerProvider.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/MessageHandler.java?p2=tomcat/trunk/java/javax/websocket/MessageHandler.java&p1=tomcat/trunk/java/javax/net/websocket/ContainerProvider.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/ContainerProvider.java (original) +++ tomcat/trunk/java/javax/websocket/MessageHandler.java Wed Nov 21 20:20:40 2012 @@ -14,17 +14,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; -public class ContainerProvider { +public interface MessageHandler { - public static ServerContainer getServerContainer() { - // TODO - return null; + interface Async<T> extends MessageHandler { + + void onMessage(T messagePart, boolean last); } - public static ClientContainer getClientContainer() { - // TODO - return null; + interface Basic<T> extends MessageHandler { + + void onMessage(T message); } } Copied: tomcat/trunk/java/javax/websocket/PingMessage.java (from r1411993, tomcat/trunk/java/javax/net/websocket/SendHandler.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/PingMessage.java?p2=tomcat/trunk/java/javax/websocket/PingMessage.java&p1=tomcat/trunk/java/javax/net/websocket/SendHandler.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/SendHandler.java (original) +++ tomcat/trunk/java/javax/websocket/PingMessage.java Wed Nov 21 20:20:40 2012 @@ -1,22 +1,23 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.net.websocket; - -public interface SendHandler { - - void setResult(SendResult result); -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package javax.websocket; + +import java.nio.ByteBuffer; + +public interface PingMessage { + ByteBuffer getApplicationData(); +} Copied: tomcat/trunk/java/javax/websocket/RemoteEndpoint.java (from r1411993, tomcat/trunk/java/javax/net/websocket/RemoteEndpoint.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/RemoteEndpoint.java?p2=tomcat/trunk/java/javax/websocket/RemoteEndpoint.java&p1=tomcat/trunk/java/javax/net/websocket/RemoteEndpoint.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/RemoteEndpoint.java (original) +++ tomcat/trunk/java/javax/websocket/RemoteEndpoint.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; import java.io.IOException; import java.io.OutputStream; @@ -23,7 +23,7 @@ import java.nio.ByteBuffer; import java.util.concurrent.Future; -public interface RemoteEndpoint<T> { +public interface RemoteEndpoint { void sendString(String text) throws IOException; @@ -37,13 +37,19 @@ public interface RemoteEndpoint<T> { Writer getSendWriter() throws IOException; - void sendObject(T o) throws IOException, EncodeException; + void sendObject(Object o) throws IOException, EncodeException; - Future<SendResult> sendString(String text, SendHandler completion); + void sendStringByCompletion(String text, SendHandler completion); - Future<SendResult> sendBytes(ByteBuffer data, SendHandler completion); + Future<SendResult> sendStringByFuture(String text); - Future<SendResult> sendObject(T o, SendHandler handler); + Future<SendResult> sendBytesByFuture(ByteBuffer data); + + void sendBytesByCompletion(ByteBuffer data, SendHandler completion); + + Future<SendResult> sendObjectByFuture(Object obj); + + void sendObjectByCompletion(Object obj, SendHandler completion); void sendPing(ByteBuffer applicationData); Copied: tomcat/trunk/java/javax/websocket/SendHandler.java (from r1411993, tomcat/trunk/java/javax/net/websocket/SendHandler.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/SendHandler.java?p2=tomcat/trunk/java/javax/websocket/SendHandler.java&p1=tomcat/trunk/java/javax/net/websocket/SendHandler.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/SendHandler.java (original) +++ tomcat/trunk/java/javax/websocket/SendHandler.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; public interface SendHandler { Copied: tomcat/trunk/java/javax/websocket/SendResult.java (from r1411993, tomcat/trunk/java/javax/net/websocket/SendResult.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/SendResult.java?p2=tomcat/trunk/java/javax/websocket/SendResult.java&p1=tomcat/trunk/java/javax/net/websocket/SendResult.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/SendResult.java (original) +++ tomcat/trunk/java/javax/websocket/SendResult.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; public class SendResult { private Throwable exception; Copied: tomcat/trunk/java/javax/websocket/ServerContainer.java (from r1411993, tomcat/trunk/java/javax/net/websocket/ServerContainer.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/ServerContainer.java?p2=tomcat/trunk/java/javax/websocket/ServerContainer.java&p1=tomcat/trunk/java/javax/net/websocket/ServerContainer.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/ServerContainer.java (original) +++ tomcat/trunk/java/javax/websocket/ServerContainer.java Wed Nov 21 20:20:40 2012 @@ -14,9 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; public interface ServerContainer extends ClientContainer { - void publishServer(Endpoint endpoint, ServerEndpointConfiguration ilc); + void publishServer(Class<? extends Endpoint> clazz) + throws DeploymentException; } Copied: tomcat/trunk/java/javax/websocket/ServerEndpointConfiguration.java (from r1411993, tomcat/trunk/java/javax/net/websocket/ServerEndpointConfiguration.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/ServerEndpointConfiguration.java?p2=tomcat/trunk/java/javax/websocket/ServerEndpointConfiguration.java&p1=tomcat/trunk/java/javax/net/websocket/ServerEndpointConfiguration.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/ServerEndpointConfiguration.java (original) +++ tomcat/trunk/java/javax/websocket/ServerEndpointConfiguration.java Wed Nov 21 20:20:40 2012 @@ -14,22 +14,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; import java.net.URI; import java.util.List; -import javax.net.websocket.extensions.Extension; - public interface ServerEndpointConfiguration extends EndpointConfiguration { String getNegotiatedSubprotocol(List<String> requestedSubprotocols); - List<Extension> getNegotiatedExtensions(List<Extension> requestedExtensions); + List<String> getNegotiatedExtensions(List<String> requestedExtensions); boolean checkOrigin(String originHeaderValue); boolean matchesURI(URI uri); void modifyHandshake(HandshakeRequest request, HandshakeResponse response); + + String getPath(); } Copied: tomcat/trunk/java/javax/websocket/Session.java (from r1411993, tomcat/trunk/java/javax/net/websocket/Session.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/Session.java?p2=tomcat/trunk/java/javax/websocket/Session.java&p1=tomcat/trunk/java/javax/net/websocket/Session.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/Session.java (original) +++ tomcat/trunk/java/javax/websocket/Session.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket; +package javax.websocket; import java.io.IOException; import java.net.URI; @@ -22,9 +22,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import javax.net.websocket.extensions.Extension; - -public interface Session<T> { +public interface Session { ClientContainer getContainer(); @@ -40,7 +38,7 @@ public interface Session<T> { String getNegotiatedSubprotocol(); - List<Extension> getNegotiatedExtensions(); + List<String> getNegotiatedExtensions(); boolean isSecure(); @@ -56,9 +54,7 @@ public interface Session<T> { long getMaximumMessageSize(); - RemoteEndpoint<?> getRemote(); - - RemoteEndpoint<T> getRemoteL(Class<T> c); + RemoteEndpoint getRemote(); void close() throws IOException; @@ -66,7 +62,9 @@ public interface Session<T> { URI getRequestURI(); - Map<String, String[]> getParameterMap(); + Map<String, String[]> getRequestParameterMap(); String getQueryString(); + + Map<String,String> getPathParameters(); } Copied: tomcat/trunk/java/javax/websocket/WebSocketClient.java (from r1411993, tomcat/trunk/java/javax/net/websocket/annotations/WebSocketClose.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/WebSocketClient.java?p2=tomcat/trunk/java/javax/websocket/WebSocketClient.java&p1=tomcat/trunk/java/javax/net/websocket/annotations/WebSocketClose.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/annotations/WebSocketClose.java (original) +++ tomcat/trunk/java/javax/websocket/WebSocketClient.java Wed Nov 21 20:20:40 2012 @@ -1,27 +1,30 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.net.websocket.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.METHOD) -public @interface WebSocketClose { -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package javax.websocket; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface WebSocketClient { + String[] subprotocols(); + Class<? extends Decoder>[] decoders(); + Class<? extends Encoder>[] encoders(); +} Copied: tomcat/trunk/java/javax/websocket/WebSocketClose.java (from r1411993, tomcat/trunk/java/javax/net/websocket/annotations/WebSocketClose.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/WebSocketClose.java?p2=tomcat/trunk/java/javax/websocket/WebSocketClose.java&p1=tomcat/trunk/java/javax/net/websocket/annotations/WebSocketClose.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/annotations/WebSocketClose.java (original) +++ tomcat/trunk/java/javax/websocket/WebSocketClose.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket.annotations; +package javax.websocket; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; Copied: tomcat/trunk/java/javax/websocket/WebSocketEndpoint.java (from r1411993, tomcat/trunk/java/javax/net/websocket/annotations/WebSocketEndpoint.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/WebSocketEndpoint.java?p2=tomcat/trunk/java/javax/websocket/WebSocketEndpoint.java&p1=tomcat/trunk/java/javax/net/websocket/annotations/WebSocketEndpoint.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/annotations/WebSocketEndpoint.java (original) +++ tomcat/trunk/java/javax/websocket/WebSocketEndpoint.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket.annotations; +package javax.websocket; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -29,7 +29,7 @@ public @interface WebSocketEndpoint { public String[] subprotocols() default {}; - public Class<?>[] decoders() default {}; + public Class<? extends Decoder>[] decoders() default {}; - public Class<?>[] encoders() default {}; + public Class<? extends Encoder>[] encoders() default {}; } Copied: tomcat/trunk/java/javax/websocket/WebSocketError.java (from r1411993, tomcat/trunk/java/javax/net/websocket/annotations/WebSocketError.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/WebSocketError.java?p2=tomcat/trunk/java/javax/websocket/WebSocketError.java&p1=tomcat/trunk/java/javax/net/websocket/annotations/WebSocketError.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/annotations/WebSocketError.java (original) +++ tomcat/trunk/java/javax/websocket/WebSocketError.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket.annotations; +package javax.websocket; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; Copied: tomcat/trunk/java/javax/websocket/WebSocketMessage.java (from r1411993, tomcat/trunk/java/javax/net/websocket/annotations/WebSocketMessage.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/WebSocketMessage.java?p2=tomcat/trunk/java/javax/websocket/WebSocketMessage.java&p1=tomcat/trunk/java/javax/net/websocket/annotations/WebSocketMessage.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/annotations/WebSocketMessage.java (original) +++ tomcat/trunk/java/javax/websocket/WebSocketMessage.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket.annotations; +package javax.websocket; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; Copied: tomcat/trunk/java/javax/websocket/WebSocketOpen.java (from r1411993, tomcat/trunk/java/javax/net/websocket/annotations/WebSocketOpen.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/WebSocketOpen.java?p2=tomcat/trunk/java/javax/websocket/WebSocketOpen.java&p1=tomcat/trunk/java/javax/net/websocket/annotations/WebSocketOpen.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/annotations/WebSocketOpen.java (original) +++ tomcat/trunk/java/javax/websocket/WebSocketOpen.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket.annotations; +package javax.websocket; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; Copied: tomcat/trunk/java/javax/websocket/WebSocketPathParam.java (from r1411993, tomcat/trunk/java/javax/net/websocket/annotations/WebSocketPathParam.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/WebSocketPathParam.java?p2=tomcat/trunk/java/javax/websocket/WebSocketPathParam.java&p1=tomcat/trunk/java/javax/net/websocket/annotations/WebSocketPathParam.java&r1=1411993&r2=1412268&rev=1412268&view=diff ============================================================================== --- tomcat/trunk/java/javax/net/websocket/annotations/WebSocketPathParam.java (original) +++ tomcat/trunk/java/javax/websocket/WebSocketPathParam.java Wed Nov 21 20:20:40 2012 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package javax.net.websocket.annotations; +package javax.websocket; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; Modified: tomcat/trunk/res/checkstyle/javax-import-control.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/javax-import-control.xml?rev=1412268&r1=1412267&r2=1412268&view=diff ============================================================================== --- tomcat/trunk/res/checkstyle/javax-import-control.xml (original) +++ tomcat/trunk/res/checkstyle/javax-import-control.xml Wed Nov 21 20:20:40 2012 @@ -33,9 +33,9 @@ <subpackage name="mail"> <allow pkg="javax.mail"/> </subpackage> - <subpackage name="net.websocket"> - <allow pkg="javax.net.websocket"/> - <allow pkg="javax.net.websocket.extensions"/> + <subpackage name="websocket"> + <allow pkg="javax.websocket"/> + <allow pkg="javax.websocket.extensions"/> </subpackage> <subpackage name="persistence"> <allow pkg="javax.persistence"/> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org