Richard S. Hall wrote:
> 
> Felix doesn't automatically delete the cache. If you want to do that, 
> just modify your application launcher to delete the directory when it 
> completes, as Karl mention belows. Another option, for debugging 
> purposes is to install your bundle JAR file by reference (e.g., 
> "reference:file:/path/to/bundle.jar"), which will not copy the bundle 
> into the cache, but will use it directly from the specified 
> location...this approach does have some limitations, but it may help
> you...
> 

Deleting the directory worked nicely. Thanks to both of you. 

    private static void setupCache(Properties configuration) {
        // Create the cache directory.
        File cacheDir = new File(SystemUtils.JAVA_IO_TMPDIR, ".felix");
        if (!cacheDir.exists()) {
            boolean madeDir = cacheDir.mkdir();
            if (!madeDir) {
                Log.log("Failed to create " + cacheDir);
            }
        }
        
        // We don't want Felix caching old copies of bundles -- we want to
start
        // from a clean slate each time, so delete its contents now.
        try {
            cleanDirectory(cacheDir);
        } catch (IOException ex) {
            Log.logException(ex);
        }

        // Explicitly set where we want bundles to be cached  
        // http://cwiki.apache.org/FELIX/apache-felix-bundle-cache.html
        configuration.setProperty(BundleCache.CACHE_PROFILE_DIR_PROP,
            cacheDir.getAbsolutePath());
    }

-- 
View this message in context: 
http://www.nabble.com/Any-way-to-disable-caching-in-embedded-mode--tp16149838p16317089.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to