felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mansour Al Akeel <mansour.alak...@gmail.com>
Subject Exploded bundle auto update
Date Sun, 02 Jun 2013 04:59:33 GMT
Hello all,

I was looking for a way to update the bundles in an exploded directory. The
documentation for FileInstall:

File Install is a directory based OSGi management agent. It uses a
directory in the file system to install and start a bundle when it is first
placed there. It updates the bundle when you update the bundle file in the
directory and, when the file is deleted, it will stop and uninstall the
bundle.

http://felix.apache.org/site/apache-felix-file-install.html
========================

What I couldn't understand is:
1- how do we specify the path to the directory to monitor. For example do
we give the path of the directory containing jars, or the exploded bundle.

Here's the relevant part of my configuration felix/conf/config.properties:


felix.auto.start.1=file:bundle/org.osgi.compendium-4.3.1.jar
felix.log.level=4

felix.startlevel.bundle=1

org.osgi.service.http.port=8080
obr.repository.url=http://felix.apache.org/obr/releases.xml

felix.fileinstall.dir=/home/mansour/workspace/example/target/classes

felix.fileinstall.poll=1000 ms
felix.fileinstall.log.level=4

felix.fileinstall.bundles.updateWithListeners=true
felix.fileinstall.bundles.new.start=true
felix.fileinstall.bundles.startTransient=true
felix.fileinstall.disableConfigSave=false

I tried to point to the directory containing the exploded bundle and the
directory containing the resulting jar. So under maven project
these are  example/target/classes  and example/target, but no luck. I tried
to rebuild the project after some modification with:

 example $ mvn clean install org.apache.felix:maven-bundle-plugin:bundle

but nothing was picked by felix. I am not sure if I am missing something. I
under stand that other tools like bndtools can help, but I don't want to
use eclipse for this.


in the gogo shell:

g! lb
START LEVEL 1
   ID|State      |Level|Name
    0|Active     |    0|System Bundle (4.2.1)
    1|Active     |    1|Apache Felix Bundle Repository (1.6.6)
    2|Active     |    1|Apache Felix Gogo Command (0.12.0)
    3|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
    4|Active     |    1|Apache Felix Gogo Shell (0.10.0)
    5|Active     |    1|osgi.cmpn (4.3.1.201210102024)
   13|Active     |    1|Apache Felix Configuration Admin Service (1.6.0)
   26|Active     |    1|example OSGi Bundle (1.0.0.SNAPSHOT)
g!


I don't know if theres is other bundles I need to install to get this to
work.

Basically, the work flow I am trying to get to is, modify code, invoke
maven build, view the new code in felix, or what otheres may call it hot
swap. Now I can invoke:

g! update 26
de-activated the bundle class com.example.Activator
DEBUG: WIRE: [26.1] osgi.wiring.package;
(&(osgi.wiring.package=org.osgi.framework)(version>=1.6.0)(!(version>=2.0.0)))
-> [0]
activated the bundle class com.example.Activator


To get the updated version, but I need a way to avoid doing this.

Is this possible without using any additional ide plugins ?

Is there anything I am missing, or misunderstood ?

Thank you.

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