Issue #3162 - Reverting not-relevant OSGi changes

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2019-01-30 12:43:36 -06:00
parent 755d5728d9
commit 26fa79a050
11 changed files with 15 additions and 20 deletions

View File

@ -74,8 +74,6 @@ public class AnnotationConfiguration extends org.eclipse.jetty.annotations.Annot
public AnnotationConfiguration() public AnnotationConfiguration()
{ {
super();
protectAndExpose("org.eclipse.jetty.osgi.annotations.");
} }
/** /**

View File

@ -44,7 +44,7 @@ import org.osgi.util.tracker.BundleTracker;
*/ */
public class BundleContextProvider extends AbstractContextProvider implements BundleProvider 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<String, App> _appMap = new HashMap<String, App>(); private Map<String, App> _appMap = new HashMap<String, App>();

View File

@ -43,7 +43,7 @@ import org.osgi.util.tracker.BundleTracker;
*/ */
public class BundleWebAppProvider extends AbstractWebAppProvider implements BundleProvider 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. * Map of Bundle to App. Used when a Bundle contains a webapp.

View File

@ -49,7 +49,7 @@ import org.osgi.util.tracker.ServiceTracker;
*/ */
public class ServiceContextProvider extends AbstractContextProvider implements ServiceProvider 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<ServiceReference, App> _serviceMap = new HashMap<>(); private Map<ServiceReference, App> _serviceMap = new HashMap<>();

View File

@ -47,7 +47,7 @@ import org.osgi.util.tracker.ServiceTracker;
*/ */
public class ServiceWebAppProvider extends AbstractWebAppProvider implements ServiceProvider 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. * Map of ServiceRef to App. Used when it is an osgi service that is a WebAppContext.

View File

@ -1,3 +1,2 @@
org.eclipse.jetty.osgi.annotations.AnnotationConfiguration org.eclipse.jetty.osgi.annotations.AnnotationConfiguration
org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration
org.eclipse.jetty.osgi.boot.OSGiMetaInfConfiguration

View File

@ -12,12 +12,10 @@
<Set name="contexts"> <Set name="contexts">
<Ref refid="Contexts" /> <Ref refid="Contexts" />
</Set> </Set>
<!--
<Call name="setContextAttribute"> <Call name="setContextAttribute">
<Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg> <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
<Arg>.*/jsp-api-[^/]*\.jar$|.*/jsp-[^/]*\.jar$</Arg> <Arg>.*/jsp-api-[^/]*\.jar$|.*/jsp-[^/]*\.jar$</Arg>
</Call> </Call>
-->
</New> </New>
</Arg> </Arg>
</Call> </Call>

View File

@ -19,10 +19,9 @@
package org.eclipse.jetty.osgi.test; package org.eclipse.jetty.osgi.test;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit; 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.Session;
import org.eclipse.jetty.websocket.api.StatusCode; import org.eclipse.jetty.websocket.api.StatusCode;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose;
@ -36,7 +35,6 @@ import org.eclipse.jetty.websocket.api.annotations.WebSocket;
@WebSocket(maxTextMessageSize = 64 * 1024) @WebSocket(maxTextMessageSize = 64 * 1024)
public class SimpleEchoSocket public class SimpleEchoSocket
{ {
private static final Logger LOG = Log.getLogger(SimpleEchoSocket.class);
private final CountDownLatch closeLatch; private final CountDownLatch closeLatch;
@SuppressWarnings("unused") @SuppressWarnings("unused")
private Session session; private Session session;
@ -54,8 +52,7 @@ public class SimpleEchoSocket
@OnWebSocketClose @OnWebSocketClose
public void onClose(int statusCode, String reason) 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.session = null;
this.closeLatch.countDown(); // trigger latch this.closeLatch.countDown(); // trigger latch
} }
@ -63,11 +60,16 @@ public class SimpleEchoSocket
@OnWebSocketConnect @OnWebSocketConnect
public void onConnect(Session session) public void onConnect(Session session)
{ {
LOG.debug("Got connect: {}", session); //System.out.printf("Got connect: %s%n",session);
this.session = session; this.session = session;
try 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"); session.close(StatusCode.NORMAL,"I'm done");
} }
@ -80,6 +82,6 @@ public class SimpleEchoSocket
@OnWebSocketMessage @OnWebSocketMessage
public void onMessage(String msg) public void onMessage(String msg)
{ {
LOG.debug("Got msg: {}", msg); //System.out.printf("Got msg: %s%n",msg);
} }
} }

View File

@ -69,7 +69,6 @@ public class TestJettyOSGiBootHTTP2Conscrypt
public Option[] config() public Option[] config()
{ {
ArrayList<Option> options = new ArrayList<>(); ArrayList<Option> options = new ArrayList<>();
options.add(TestOSGiUtil.optionalRemoteDebug());
options.add(CoreOptions.junitBundles()); options.add(CoreOptions.junitBundles());
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(true,"jetty-http2.xml")); options.addAll(TestOSGiUtil.configureJettyHomeAndPort(true,"jetty-http2.xml"));
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.xml.*", "javax.activation.*")); options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.xml.*", "javax.activation.*"));

View File

@ -64,7 +64,7 @@ public class TestJettyOSGiBootWithJavaxWebSocket
public static Option[] configure() public static Option[] configure()
{ {
ArrayList<Option> options = new ArrayList<>(); ArrayList<Option> options = new ArrayList<>();
options.add(TestOSGiUtil.optionalRemoteDebug()); // options.add(TestOSGiUtil.optionalRemoteDebug());
options.add(CoreOptions.junitBundles()); options.add(CoreOptions.junitBundles());
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(false, "jetty-http-boot-with-javax-websocket.xml")); options.addAll(TestOSGiUtil.configureJettyHomeAndPort(false, "jetty-http-boot-with-javax-websocket.xml"));
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.sql.*","javax.xml.*", "javax.activation.*")); options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.sql.*","javax.xml.*", "javax.activation.*"));

View File

@ -55,7 +55,6 @@ public class TestJettyOSGiBootWithWebSocket
public static Option[] configure() public static Option[] configure()
{ {
ArrayList<Option> options = new ArrayList<>(); ArrayList<Option> options = new ArrayList<>();
options.add(TestOSGiUtil.optionalRemoteDebug());
options.add(CoreOptions.junitBundles()); options.add(CoreOptions.junitBundles());
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(false, "jetty-http-boot-with-websocket.xml")); 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.*")); options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.sql.*","javax.xml.*", "javax.activation.*"));