Ted,
Certainly sounds like the simplest approach. You should really create an
issue for this in JIRA and attach your patch to it:
http://issues.apache.org/jira/browse/FELIX
Make sure to check the grant checkbox.
-> richard
On 5/3/09 12:19 PM, Ted Stockwell wrote:
Hi All,
After thinking about how to customize the system bundle cache, with a eye on
not making the base code bigger, it struck me that the simplest thing to do
would be to pass a BundleCache implementation in the configuration map that is
passed to the Felix construction, as is done for system activators.
So for now I have added this code to the FelixConstants class...
public static final String SYSTEMBUNDLE_BUNDLE_CACHE
= "felix.systembundle.bundle.cache";
and I added this code to the Felix.init method...
// Create the bundle cache, if necessary, so that we can reload any installed
bundles.
m_cache= (BundleCache)
m_configMutableMap.get(FelixConstants.SYSTEMBUNDLE_BUNDLE_CACHE);
if (m_cache == null)
{
try
{
m_cache = new BundleCache(m_logger, m_configMap);
}
catch (Exception ex)
{
m_logger.log(Logger.LOG_ERROR, "Error creating bundle cache.", ex);
throw new BundleException("Error creating bundle cache.", ex);
}
}
then in my code I do this....
configMap.put(FelixConstants.SYSTEMBUNDLE_BUNDLE_CACHE, new
Felix4GAEBundleCache());
Felix framework= new Felix(configMap);
I have attached a patch file if you are inclined to apply these changes.
Thanks,
-ted
BTW, I will release felix4gae here, http://code.google.com/p/felix4gae.
I am working on this in the evenings so it will probably take a couple of weeks.
--- On Fri, 5/1/09, Richard S. Hall<[email protected]> wrote:
From: Richard S. Hall<[email protected]>
Subject: Re: Custom BundleCache?
To: [email protected]
Date: Friday, May 1, 2009, 12:44 PM
On 5/1/09 8:37 AM, Ted Stockwell wrote:
Is the custom BundleCache something that the Felix
group might be interested in merging back into the Felix
code? (that's another reason for my asking, it would be
nice if eventually my custom version of Felix was extending
Felex in a supported fashion instead of 'hacking'
Felix with some custom classes).
I would be interested in an improved abstraction for
Felix' bundle cache, but I wouldn't want anything
too heavyweight. I am not sure how sophisticated/complicated
the Apache VFS is, but if it were to add more than just a
few classes, it would likely be too much for me. And it also
couldn't introduce any dependencies on Java 5 or beyond.
Is that do-able? If so, we can definitely talk more about
it.
-> richard
------------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]