Search code examples
osgiapache-felix

Felix clean cache dir


I found this topic about Felix cache

Disabling Cache in Apache Felix

Can you give me some example how I can use below code because I can't find configurationProperties.

configurationProperties.setProperty(Constants.FRAMEWORK_STORAGE_CLEAN, Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);

Solution

  • You could use code from this page: How to start and use Apache Felix from code?

    In this code configurationProperties is names just map.

    Map<String, Object> map = new HashMap<String, Object>();
    map.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA,
        "some.module.i.dont.know; version=1.0.0");
    

    You could set your property:

    map.setProperty(Constants.FRAMEWORK_STORAGE_CLEAN, Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);