felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rémi Druilhe <remi.drui...@cea.fr>
Subject [iPOJO] Modifying a metadata.xml property directly in the JAR
Date Tue, 19 Aug 2014 08:15:47 GMT
Hello,

I just created a TCP client to communicate with a server using iPOJO. 
For now, I used the property fields into the component "instance" to 
configure the IP address of my server. Something like that :

<instance component="tcp-handler">
         <property name="serverIp" value="xxx.xxx.xxx.xxx"/>
         <property name="serverPort" value="yyyy"/>
</instance>

My purpose is to easily modify this configuration when I move my server 
on another device without asking the user to set the IP address 
everytime the client is started. And i'd like not to use a config file 
because I assume that the metadata.xml is already some kind of a config 
file.

So, I though that using "instance" enables me to modify the metadata.xml 
file into the JAR file and update this JAR with the new value. In fact, 
Ubuntu asks if I want to update the archive after modifying a file and I 
say yes. I can see the change when I reopen the archive.

However, it seems that when my client is launched in Felix, it always 
uses the old IP address despite changes I made in the JAR file.

What's wrong with my way of configuring my component ? Is it possible to 
modify a file into a JAR file ? Is the value of my property is 
definitively set into the component "instance" in the metadata.xml (like 
a static field) ?

Thanks,

Regards.

-- 
Rémi Druilhe


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message