Author: markt
Date: Wed May 22 23:12:14 2013
New Revision: 1485490
URL: http://svn.apache.org/r1485490
Log:
Revert r1485458. Right idea but that isn't how to do it.
Modified:
tomcat/trunk/test/org/apache/tomcat/websocket/TesterSingleMessageClient.java
Modified:
tomcat/trunk/test/org/apache/tomcat/websocket/TesterSingleMessageClient.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/TesterSingleMessageClient.java?rev=1485490&r1=1485489&r2=1485490&view=diff
==============================================================================
---
tomcat/trunk/test/org/apache/tomcat/websocket/TesterSingleMessageClient.java
(original)
+++
tomcat/trunk/test/org/apache/tomcat/websocket/TesterSingleMessageClient.java
Wed May 22 23:12:14 2013
@@ -35,19 +35,19 @@ public class TesterSingleMessageClient {
public static class TesterProgrammaticEndpoint extends Endpoint {
- private CountDownLatch latch = null;
-
@Override
public void onClose(Session session, CloseReason closeReason) {
- clearLatch();
+ clearLatch(session);
}
@Override
public void onError(Session session, Throwable throwable) {
- clearLatch();
+ clearLatch(session);
}
- private void clearLatch() {
+ private void clearLatch(Session session) {
+ CountDownLatch latch =
+ (CountDownLatch) session.getUserProperties().get("latch");
if (latch != null) {
while (latch.getCount() > 0) {
latch.countDown();
@@ -57,26 +57,27 @@ public class TesterSingleMessageClient {
@Override
public void onOpen(Session session, EndpointConfig config) {
- latch = (CountDownLatch) session.getUserProperties().get("latch");
+ // NO-OP
}
}
@ClientEndpoint
public static class TesterAnnotatedEndpoint {
- private CountDownLatch latch = null;
-
@OnClose
- public void onClose() {
- clearLatch();
+ public void onClose(Session session) {
+ clearLatch(session);
}
@OnError
- public void onError(@SuppressWarnings("unused") Throwable throwable) {
- clearLatch();
+ public void onError(Session session,
+ @SuppressWarnings("unused") Throwable throwable) {
+ clearLatch(session);
}
- private void clearLatch() {
+ private void clearLatch(Session session) {
+ CountDownLatch latch =
+ (CountDownLatch) session.getUserProperties().get("latch");
if (latch != null) {
while (latch.getCount() > 0) {
latch.countDown();
@@ -85,8 +86,8 @@ public class TesterSingleMessageClient {
}
@OnOpen
- public void onOpen(Session session) {
- latch = (CountDownLatch) session.getUserProperties().get("latch");
+ public void onOpen() {
+ // NO-OP
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]