Hi Steinar, yep, it's called the whiteboard pattern. For that you just need to expose your servlets as services, the whiteboard-extender of pax web will take care of the rest. For a full list of possibilities take a look at the following samples and itests. [1] lists the first whiteboard sample but I'm sure you're able to find the other whtieboard-* samples as well ;) [2], is just one of the possible tests, again there are a bunch of other itests checking the various samples.
regards, Achim [1] - https://github.com/ops4j/org.ops4j.pax.web/tree/master/samples/whiteboard [2] - https://github.com/ops4j/org.ops4j.pax.web/blob/master/pax-web-itest/pax-web-itest-container/pax-web-itest-container-jetty/src/test/java/org/ops4j/pax/web/itest/jetty/WhiteboardServletAnnotatedIntegrationTest.java 2017-04-29 8:54 GMT+02:00 Steinar Bang <[email protected]>: > The pax web examples show how one can listen for the WebContainer OSGi > service, and then use this service to register and unregister servlets > and other web resources: > https://github.com/ops4j/org.ops4j.pax.web/blob/master/ > samples/helloworld-wc/src/main/java/org/ops4j/pax/web/ > samples/helloworld/wc/internal/Activator.java#L51 > > Is there a way to turn this approach on its head? > > Ie. is there a service that my webapp could expose, that will be picked > up by the webcontainer and used to register a webapp (or even: used > directly as the webapp)? > > Thanks! > > > - Steinar > > -- > -- > ------------------ > OPS4J - http://www.ops4j.org - [email protected] > > --- > You received this message because you are subscribed to the Google Groups > "OPS4J" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> Software Architect / Project Manager / Scrum Master -- -- ------------------ OPS4J - http://www.ops4j.org - [email protected] --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
