svn commit: r1816418 - in /tomcat/trunk: java/javax/websocket/WebSocketContainer.java java/org/apache/tomcat/websocket/WsWebSocketContainer.java test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1816418 - in /tomcat/trunk: java/javax/websocket/WebSocketContainer.java java/org/apache/tomcat/websocket/WsWebSocketContainer.java test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java

markt
Author: markt
Date: Mon Nov 27 10:33:22 2017
New Revision: 1816418

URL: http://svn.apache.org/viewvc?rev=1816418&view=rev
Log:
Getter and setter should use symmetric names

Modified:
    tomcat/trunk/java/javax/websocket/WebSocketContainer.java
    tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
    tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java

Modified: tomcat/trunk/java/javax/websocket/WebSocketContainer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/WebSocketContainer.java?rev=1816418&r1=1816417&r2=1816418&view=diff
==============================================================================
--- tomcat/trunk/java/javax/websocket/WebSocketContainer.java (original)
+++ tomcat/trunk/java/javax/websocket/WebSocketContainer.java Mon Nov 27 10:33:22 2017
@@ -33,9 +33,20 @@ public interface WebSocketContainer {
      * Set the default timeout for sending a message asynchronously.
      * @param timeout The new default timeout in milliseconds. A non-positive
      *                value means an infinite timeout.
+     *
+     * @deprecated This will be removed in Tomcat 9.
+     *             Use {@link #setDefaultAsyncSendTimeout(long)}
      */
+    @Deprecated
     void setAsyncSendTimeout(long timeout);
 
+    /**
+     * Set the default timeout for sending a message asynchronously.
+     * @param timeout The new default timeout in milliseconds. A non-positive
+     *                value means an infinite timeout.
+     */
+    void setDefaultAsyncSendTimeout(long timeout);
+
     Session connectToServer(Object endpoint, URI path)
             throws DeploymentException, IOException;
 

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java?rev=1816418&r1=1816417&r2=1816418&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java Mon Nov 27 10:33:22 2017
@@ -986,10 +986,22 @@ public class WsWebSocketContainer implem
      * The default value for this implementation is -1.
      */
     @Override
+    @Deprecated
     public void setAsyncSendTimeout(long timeout) {
         this.defaultAsyncTimeout = timeout;
     }
 
+
+    /**
+     * {@inheritDoc}
+     *
+     * The default value for this implementation is -1.
+     */
+    @Override
+    public void setDefaultAsyncSendTimeout(long timeout) {
+        this.defaultAsyncTimeout = timeout;
+    }
+
 
     /**
      * Cleans up the resources still in use by WebSocket sessions created from

Modified: tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java?rev=1816418&r1=1816417&r2=1816418&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java Mon Nov 27 10:33:22 2017
@@ -325,7 +325,7 @@ public class TestWsWebSocketContainer ex
 
         // Set the async timeout
         if (setTimeoutOnContainer) {
-            wsContainer.setAsyncSendTimeout(TIMEOUT_MS);
+            wsContainer.setDefaultAsyncSendTimeout(TIMEOUT_MS);
         }
 
         tomcat.start();
@@ -606,7 +606,7 @@ public class TestWsWebSocketContainer ex
                 sc.addEndpoint(ServerEndpointConfig.Builder.create(
                         ConstantTxEndpoint.class, PATH).build());
                 if (TestWsWebSocketContainer.timeoutOnContainer) {
-                    sc.setAsyncSendTimeout(TIMEOUT_MS);
+                    sc.setDefaultAsyncSendTimeout(TIMEOUT_MS);
                 }
             } catch (DeploymentException e) {
                 throw new IllegalStateException(e);



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1816418 - in /tomcat/trunk: java/javax/websocket/WebSocketContainer.java java/org/apache/tomcat/websocket/WsWebSocketContainer.java test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java

Emmanuel Bourg
Le 27/11/2017 à 11:33, [hidden email] a écrit :

> Modified: tomcat/trunk/java/javax/websocket/WebSocketContainer.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/WebSocketContainer.java?rev=1816418&r1=1816417&r2=1816418&view=diff
> ==============================================================================
> --- tomcat/trunk/java/javax/websocket/WebSocketContainer.java (original)
> +++ tomcat/trunk/java/javax/websocket/WebSocketContainer.java Mon Nov 27 10:33:22 2017
> @@ -33,9 +33,20 @@ public interface WebSocketContainer {
>       * Set the default timeout for sending a message asynchronously.
>       * @param timeout The new default timeout in milliseconds. A non-positive
>       *                value means an infinite timeout.
> +     *
> +     * @deprecated This will be removed in Tomcat 9.
> +     *             Use {@link #setDefaultAsyncSendTimeout(long)}
>       */
> +    @Deprecated
>      void setAsyncSendTimeout(long timeout);
>  
> +    /**
> +     * Set the default timeout for sending a message asynchronously.
> +     * @param timeout The new default timeout in milliseconds. A non-positive
> +     *                value means an infinite timeout.
> +     */
> +    void setDefaultAsyncSendTimeout(long timeout);
> +

Hi Mark,

The extra setDefaultAsyncSendTimeout method in WebSocketContainer isn't
defined in the WebSocket API 1.1. Is this divergence with the
specification intended? In Debian the tomcat-websocket-api artifact is
used as the reference WebSocket API and this change caused a couple of
packages to fail to build.

Emmanuel Bourg

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1816418 - in /tomcat/trunk: java/javax/websocket/WebSocketContainer.java java/org/apache/tomcat/websocket/WsWebSocketContainer.java test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java

markt
On 11/12/17 00:21, Emmanuel Bourg wrote:

> Le 27/11/2017 à 11:33, [hidden email] a écrit :
>
>> Modified: tomcat/trunk/java/javax/websocket/WebSocketContainer.java
>> URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/websocket/WebSocketContainer.java?rev=1816418&r1=1816417&r2=1816418&view=diff
>> ==============================================================================
>> --- tomcat/trunk/java/javax/websocket/WebSocketContainer.java (original)
>> +++ tomcat/trunk/java/javax/websocket/WebSocketContainer.java Mon Nov 27 10:33:22 2017
>> @@ -33,9 +33,20 @@ public interface WebSocketContainer {
>>       * Set the default timeout for sending a message asynchronously.
>>       * @param timeout The new default timeout in milliseconds. A non-positive
>>       *                value means an infinite timeout.
>> +     *
>> +     * @deprecated This will be removed in Tomcat 9.
>> +     *             Use {@link #setDefaultAsyncSendTimeout(long)}
>>       */
>> +    @Deprecated
>>      void setAsyncSendTimeout(long timeout);
>>  
>> +    /**
>> +     * Set the default timeout for sending a message asynchronously.
>> +     * @param timeout The new default timeout in milliseconds. A non-positive
>> +     *                value means an infinite timeout.
>> +     */
>> +    void setDefaultAsyncSendTimeout(long timeout);
>> +
>
> Hi Mark,
>
> The extra setDefaultAsyncSendTimeout method in WebSocketContainer isn't
> defined in the WebSocket API 1.1. Is this divergence with the
> specification intended? In Debian the tomcat-websocket-api artifact is
> used as the reference WebSocket API and this change caused a couple of
> packages to fail to build.

That is an error on my part. I'll get it fixed.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]