From 26fa79a0500d2f8ded1714b2bf3092ad883cc9c6 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 30 Jan 2019 12:43:36 -0600 Subject: [PATCH] Issue #3162 - Reverting not-relevant OSGi changes Signed-off-by: Joakim Erdfelt --- .../annotations/AnnotationConfiguration.java | 2 -- .../jetty/osgi/boot/BundleContextProvider.java | 2 +- .../jetty/osgi/boot/BundleWebAppProvider.java | 2 +- .../osgi/boot/ServiceContextProvider.java | 2 +- .../jetty/osgi/boot/ServiceWebAppProvider.java | 2 +- .../org.eclipse.jetty.webapp.Configuration | 1 - .../src/test/config/etc/jetty-deployer.xml | 2 -- .../jetty/osgi/test/SimpleEchoSocket.java | 18 ++++++++++-------- .../test/TestJettyOSGiBootHTTP2Conscrypt.java | 1 - .../TestJettyOSGiBootWithJavaxWebSocket.java | 2 +- .../test/TestJettyOSGiBootWithWebSocket.java | 1 - 11 files changed, 15 insertions(+), 20 deletions(-) diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java index 456245bb18a..fddb0e8cc0d 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java @@ -74,8 +74,6 @@ public class AnnotationConfiguration extends org.eclipse.jetty.annotations.Annot public AnnotationConfiguration() { - super(); - protectAndExpose("org.eclipse.jetty.osgi.annotations."); } /** diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java index ed82f560aee..e88526a0d86 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java @@ -44,7 +44,7 @@ import org.osgi.util.tracker.BundleTracker; */ public class BundleContextProvider extends AbstractContextProvider implements BundleProvider { - private static final Logger LOG = Log.getLogger(BundleContextProvider.class); + private static final Logger LOG = Log.getLogger(AbstractContextProvider.class); private Map _appMap = new HashMap(); diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java index f1fff9c45c5..a3768471d2b 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java @@ -43,7 +43,7 @@ import org.osgi.util.tracker.BundleTracker; */ public class BundleWebAppProvider extends AbstractWebAppProvider implements BundleProvider { - private static final Logger LOG = Log.getLogger(BundleWebAppProvider.class); + private static final Logger LOG = Log.getLogger(AbstractWebAppProvider.class); /** * Map of Bundle to App. Used when a Bundle contains a webapp. diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java index bb2246d53ca..783a3e98fe9 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java @@ -49,7 +49,7 @@ import org.osgi.util.tracker.ServiceTracker; */ public class ServiceContextProvider extends AbstractContextProvider implements ServiceProvider { - private static final Logger LOG = Log.getLogger(ServiceContextProvider.class); + private static final Logger LOG = Log.getLogger(AbstractContextProvider.class); private Map _serviceMap = new HashMap<>(); diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java index 6c7f8957229..4ffa0177905 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java @@ -47,7 +47,7 @@ import org.osgi.util.tracker.ServiceTracker; */ public class ServiceWebAppProvider extends AbstractWebAppProvider implements ServiceProvider { - private static final Logger LOG = Log.getLogger(ServiceWebAppProvider.class); + private static final Logger LOG = Log.getLogger(AbstractWebAppProvider.class); /** * Map of ServiceRef to App. Used when it is an osgi service that is a WebAppContext. diff --git a/jetty-osgi/jetty-osgi-boot/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration b/jetty-osgi/jetty-osgi-boot/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration index 7bda8437fdf..f6709863026 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration +++ b/jetty-osgi/jetty-osgi-boot/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration @@ -1,3 +1,2 @@ org.eclipse.jetty.osgi.annotations.AnnotationConfiguration org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration -org.eclipse.jetty.osgi.boot.OSGiMetaInfConfiguration diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-deployer.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-deployer.xml index f3acb5ecf6e..19b3a5db090 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-deployer.xml +++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-deployer.xml @@ -12,12 +12,10 @@ - diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java index beeaec682f5..0629ca8600d 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/SimpleEchoSocket.java @@ -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 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); } } diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java index f7bd451ab54..6049796b761 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java @@ -69,7 +69,6 @@ public class TestJettyOSGiBootHTTP2Conscrypt public Option[] config() { ArrayList