[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.equinox] Re: HttpConfiguration: change timeout by aQute fileinstall

Oliver,

The problem is really that FileInstall is a limited tool that can only cope with String properties. If you have a ManagedService or ManagedServiceFactory that requires non-String properties then you are out of luck using FileInstall as your management agent.

You could build your own management agent, or enhance FileInstall. Note that it is Apache V2 licensed, and I'm sure that Peter would accept back useful patches. Of course the key question is how FileInstall is supposed to know what type to convert each property to... you could perhaps investigate using the Metatype service for this.

Regards,
Neil


Oliver Vesper wrote:
Hi folks,

I'm using successfully the equinox implementation of the OSGI HttpService. Now I'd like to change the http timeout to a larger value than the default of 30 seconds. As I am already using aQute fileinstall (www.aqute.biz/Code/FileInstall), I tried to change the timeout with a configuration file of the name "org.eclipse.equinox.http.HttpFactory-default.cfg" - the content looks like this:
http.timeout = 600


As the timeout did not change I started debugging the updated(String, Dictionary)-method of the class HttpConfiguration (which is actually being called) and realized the problem: the given timeoutProperty must be of type int - but it is of type String and therefore a ConfigurationException is thrown. The fileinstall documentation states "Notice that this model only supports String properties"...

So my question is how to get this working? Would it be a good idea to check within the HttpConfiguration's updated-method if the timeoutProperty is of type String and try to parse/convert it to an Integer? Is there a different approach?

My current workaround is to look through the ManagedServices for the HttpConfiguration and call its updated-method with a Dictionary-parameter containing a timeoutProperty of type int. It works but causes compile-warnings (Discouraged access).

Thanks in advance!
Oliver