Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » HTTP-Plugin with dynamic port from configuration?
HTTP-Plugin with dynamic port from configuration? [message #94916] Wed, 15 August 2007 08:24 Go to next message
Stephan is currently offline StephanFriend
Messages: 14
Registered: July 2009
Junior Member
Hi

I know that I can set the system property "org.osgi.service.http.port" to define the port for the HTTP-Plugin. In my case, the port should be read from an external configuration file and is only known after my application is started. Currently, I set the system property in my code but I also read, that "osgi.*" properties should be defined outside of the runtime (and not in code).

The second problem is that the next time I start my application, the HTTP-Plugin is started before my application and the port is not set yet. Starting with -clean works around the problem. I tried changing config.ini but had no success.

Is it safe to set the property in the code or is there some other way to define the port?

Thanks, Stephan
Re: HTTP-Plugin with dynamic port from configuration? [message #94987 is a reply to message #94916] Wed, 15 August 2007 17:28 Go to previous message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
Hi Stephan,

I would only use System Properties if you know which port you want to use
beforehand, when launching the process.

If you're using the Jetty based implementation you might want to take a look
at JettyConfigurator and use that to explicitly start your instance each
time.
You can also do the same thing using ConfigAdmin service which will
persistently save your port (and other) settings.

HTH
-Simon



"Stephan Sigrist" <stephan.sigrist@diligent-it.com> wrote in message
news:147055834.5621187166320401.JavaMail.root@cp9.dzone.com...
> Hi
>
> I know that I can set the system property "org.osgi.service.http.port" to
> define the port for the HTTP-Plugin. In my case, the port should be read
> from an external configuration file and is only known after my application
> is started. Currently, I set the system property in my code but I also
> read, that "osgi.*" properties should be defined outside of the runtime
> (and not in code).
>
> The second problem is that the next time I start my application, the
> HTTP-Plugin is started before my application and the port is not set yet.
> Starting with -clean works around the problem. I tried changing config.ini
> but had no success.
>
> Is it safe to set the property in the code or is there some other way to
> define the port?
>
> Thanks, Stephan
Previous Topic:App server from within RCP
Next Topic:Easier way to start bundles
Goto Forum:
  


Current Time: Mon Sep 23 02:49:11 GMT 2024

Powered by FUDForum. Page generated in 0.05919 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top