2 Replies Latest reply on Jun 5, 2009 3:54 PM by Peter Chandler

    FUSE OSGI User configuration file repository/location.

    Peter Chandler Master

      I would like to share configuration files (XML, XSD, INI, ...) across OSGi bundles. For deployment/portability reasons I would like to stored the file inside of FUSE container (not on the local file system). The Sonic ESB, has the "Sonic file system". Does FUSE have its own file system? Where is the recommend location for User configuration files? Is there BundleContext property that return the ServiceMix execution root directory? What's the difference between servicemix.home and servicemix.base?


      Sorry for all the questions, Thanks in advance,



        • 1. Re: FUSE OSGI User configuration file repository/location.
          Stan Lewis Novice

          servicemix.home is the root of the servicemix installation.  servicemix.base is the servicemix process's working directory, generally the same as servicemix.home if you always start servicemix from the root of your servicemix install with "./bin/servicemix".  Unfortunately servicemix doesn't have the same concept as the "Sonic file system".  Thanks to apache felix though there's an implementation of the Configuration Admin running that you could use, though I'm not certain this is what you're looking for -  http://felix.apache.org/site/apache-felix-configuration-admin-service.html

          • 2. Re: FUSE OSGI User configuration file repository/location.
            Peter Chandler Master

            Thanks for the information, the Admin Service looks interesting. However, if I have configuration files for Spring, XSD, ... is there a "Best Practice" location for these files in ServiceMix? Is there some type of standard deployment directory layout?


            Here is what I am thinking:

            Each bundle can do a:

               String myConfigDirectory = BundleContext.getProperty(servicemix.base)/my_app_config


            Then all my bundles can looking in to the same directory "my_app_config" for their config files. Also, when I upgrade to a new version of FUSE or move to a new machine I just have to copy over the my_app_config directory to the new installation.


            Is there a better way?