Is there a possibility (API) to add Jetty connectors via Pax-Web programmatically. Pax-Web internally uses a nice JettyServer
interface, but there seems to be no OSGi service available. The ports that must be available are not known in advance, so I cannot use jetty.xml
for configuration purposes.
Has anybody an idea?
As you just seem to want to change the port you should do it the OSGi way and just configure pax web with the appropriate configuration. See also here: https://ops4j1.jira.com/wiki/display/paxweb/Basic+Configuration
The configuration in question is org.osgi.service.http.port
This port can be configured by the config admin service. In case of a configuration change the jetty server will be restarted.
Regarding the initial question about a service, this is not possible right now but there is a JIRA issue for it available, and contributions are highly appreciated.