Issue #3162 - Reverting not-relevant OSGi changes
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
parent
e135197066
commit
72ad74866c
|
@ -19,10 +19,9 @@
|
|||
package org.eclipse.jetty.osgi.test;
|
||||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.websocket.api.Session;
|
||||
import org.eclipse.jetty.websocket.api.StatusCode;
|
||||
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose;
|
||||
|
@ -36,7 +35,6 @@ import org.eclipse.jetty.websocket.api.annotations.WebSocket;
|
|||
@WebSocket(maxTextMessageSize = 64 * 1024)
|
||||
public class SimpleEchoSocket
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(SimpleEchoSocket.class);
|
||||
private final CountDownLatch closeLatch;
|
||||
@SuppressWarnings("unused")
|
||||
private Session session;
|
||||
|
@ -54,8 +52,7 @@ public class SimpleEchoSocket
|
|||
@OnWebSocketClose
|
||||
public void onClose(int statusCode, String reason)
|
||||
{
|
||||
LOG.debug("Connection closed: {} - {}", statusCode, reason);
|
||||
|
||||
//System.out.printf("Connection closed: %d - %s%n",statusCode,reason);
|
||||
this.session = null;
|
||||
this.closeLatch.countDown(); // trigger latch
|
||||
}
|
||||
|
@ -63,11 +60,16 @@ public class SimpleEchoSocket
|
|||
@OnWebSocketConnect
|
||||
public void onConnect(Session session)
|
||||
{
|
||||
LOG.debug("Got connect: {}", session);
|
||||
//System.out.printf("Got connect: %s%n",session);
|
||||
this.session = session;
|
||||
try
|
||||
{
|
||||
session.getRemote().sendString("Foo");
|
||||
Future<Void> fut;
|
||||
//System.err.println("Sending Foo!");
|
||||
fut = session.getRemote().sendStringByFuture("Foo");
|
||||
|
||||
fut.get(2,TimeUnit.SECONDS); // wait for send to complete.
|
||||
//System.err.println("Foo complete");
|
||||
|
||||
session.close(StatusCode.NORMAL,"I'm done");
|
||||
}
|
||||
|
@ -80,6 +82,6 @@ public class SimpleEchoSocket
|
|||
@OnWebSocketMessage
|
||||
public void onMessage(String msg)
|
||||
{
|
||||
LOG.debug("Got msg: {}", msg);
|
||||
//System.out.printf("Got msg: %s%n",msg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,6 @@ public class TestJettyOSGiBootWithWebSocket
|
|||
public static Option[] configure()
|
||||
{
|
||||
ArrayList<Option> options = new ArrayList<>();
|
||||
options.add(TestOSGiUtil.optionalRemoteDebug());
|
||||
options.add(CoreOptions.junitBundles());
|
||||
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(false, "jetty-http-boot-with-websocket.xml"));
|
||||
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.sql.*","javax.xml.*", "javax.activation.*"));
|
||||
|
|
Loading…
Reference in New Issue