sonatype/nexus-oss — pull request #632 by mcculls (2014-07-16 17:59:31+00:00)
Title: POC: defer Jetty activation

Currently on master Jetty will finish bootstrapping and use a placeholder (that just serves empty content) while Nexus finishes its initialisation (at which point the web context will delegate to the newly registered services). This loose-coupling lets us manage Jetty and Nexus separately rather than as a monolithic application, but it does means that port 8081 is visible before Nexus is fully initialised.

It's important to note that none of Nexus internal components are actually reachable via that connection until Nexus has fully initialised (ditto for the shutdown case). Despite this, people may still prefer Jetty to only make the 8081 port available when the service is actually ready to handle requests.

This can be achieved by deferring Jetty activation until Nexus is ready. This PR bootstraps Jetty on a separate thread rather than on the OSGi activation thread. This means we can then wait for the internal Nexus services to be ready in the BootstrapListener without blocking activation of other bundle activators.

The downside is we have the overhead of an extra thread during initialisation (it doesn't exist after this point).

http://bamboo.s/browse/NX-OSSF161-1 :white_check_mark:

WDYT?