From 414f964afda9f0fef9ad41a071c97d0830c180fb Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 6 Nov 2012 16:58:49 -0700 Subject: [PATCH] Making changes to client / server from api / common --- .../server/helper/FinishedFuture.java | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/helper/FinishedFuture.java diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/helper/FinishedFuture.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/helper/FinishedFuture.java new file mode 100644 index 00000000000..a241e8d7911 --- /dev/null +++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/helper/FinishedFuture.java @@ -0,0 +1,52 @@ +// +// ======================================================================== +// Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd. +// ------------------------------------------------------------------------ +// All rights reserved. This program and the accompanying materials +// are made available under the terms of the Eclipse Public License v1.0 +// and Apache License v2.0 which accompanies this distribution. +// +// The Eclipse Public License is available at +// http://www.eclipse.org/legal/epl-v10.html +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// + +package org.eclipse.jetty.websocket.server.helper; + +import java.util.concurrent.Callable; +import java.util.concurrent.Future; +import java.util.concurrent.FutureTask; + +import javax.net.websocket.SendResult; + +public class FinishedFuture extends FutureTask implements Future +{ + public static Future INSTANCE; + + static + { + Callable callable = new Callable() + { + @Override + public SendResult call() throws Exception + { + return new SendResult(); + } + }; + + FinishedFuture fut = new FinishedFuture(callable); + fut.run(); + + INSTANCE = fut; + } + + public FinishedFuture(Callable callable) + { + super(callable); + } +}