Hi Nicolas,

I fear right now this isn't possible.
As Pax Web doesn't expose a "Jetty service".

It would need the following changes:
The JettyFactory would also need to listen to Connectors and restart the
jetty instance every time this changes.

But what you could do:
Configure a bunch of connectors (Virtual Hosts) on Jetty, so they are
available.
Now your webapp-mgmnt application registers each new application with a new
configuration bound to a free instance of your already configured virtual
hosts.

Take a look at the following sample:
https://github.com/ops4j/org.ops4j.pax.web/blob/master/samples/whiteboard-extended/src/main/java/org/ops4j/pax/web/extender/samples/whiteboard/internal/Activator.java

regards, Achim



2017-09-07 13:27 GMT+02:00 Nicolas Brasey <nicolas.bra...@gmail.com>:

> Hi,
>
> With Karaf 4.1.2, I'm trying to programmatically configure Jetty to deploy
> web bundles on different http ports.
>
> For example, I'm trying the achieve the following scenario:
>
> Karaf root instance:
>    admin-web-app on port 8181
>
> Karaf instance 1:
>    my-web-app-1 on port 10081
>
> Karaf instance 2:
>    my-web-app-2 on port 10082
>
> Karaf instance 3:
>    my-web-app-1 on port 10083
>    my-web-app-3 on port 10084
>
>
> But this scenario is also possible:
>
> Karaf root instance:
>    admin-web-app on port 8181
>    my-web-app-1 on port 10081
>    my-web-app-1 on port 10082
>    my-web-app-2 on port 10083
>    my-web-app-3 on port 10084
>
>
> My constraints are that the ports and the context path is not known at
> compile time, it will be dynamically resolved at runtime from a deployment
> configuration file.
>
> What would be the best approach to implement such thing ?
>
> My initial idea would be to have a webapp-mgmnt module who listens on new
> web bundle and deploys it properly using the configuration setting (ports,
> instances).
>
> Some initial questions I have:
>
> 1) How to listen on new bundle that have a give meta information in the
> manifest ?
> 2) How to access the Jetty server from the app code ?
>
> Thanks a lot
> Nicolas
>
> --
> --
> ------------------
> OPS4J - http://www.ops4j.org - ops4j@googlegroups.com
>
> ---
> 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 ops4j+unsubscr...@googlegroups.com.
> 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 - ops4j@googlegroups.com

--- 
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 ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to