felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger" <Felix.Meschber...@day.com>
Subject Re: Shutting down the framework
Date Tue, 20 Jun 2006 09:43:46 GMT
Thanks. It works for me.

Regards
Felix

On 6/20/06, Richard S. Hall <heavy@ungoverned.org> wrote:
> Done. Let me know if it is working fine for you.
>
> -> richard
>
> Felix Meschberger wrote:
> > Hi Richard,
> >
> > Thanks alot.
> >
> > Regards
> > Felix, the person :-)
> >
> > On 6/20/06, Richard S. Hall <heavy@ungoverned.org> wrote:
> >> Yes, you are correct, the current approach is not aggressive enough
> >> since it relies on GC, which is probably not the best idea. I will add
> >> your patch below to the shutdown method and commit shortly.
> >>
> >> -> richard
> >>
> >> Felix Meschberger wrote:
> >> > Hi again,
> >> >
> >> > During my tests of replacing plain file system access with a
> >> > factory-based resource wrapper, I noticed, that on shutdown of the
> >> > framework, the modules are not properly closed. Thus the jar files
> >> > remain open until either garbage collected or the vm exits.
> >> >
> >> > Shouldn't the Felix.shutdown() method close those modules doing
> >> > something like:
> >> >
> >> >        bundles = getBundles();
> >> >        for (int i = 0; i < bundles.length; i++) {
> >> >            BundleImpl bundle = (BundleImpl) bundles[i];
> >> >            try {
> >> >                IModule[] modules = bundle.getInfo().getModules();
> >> >                for (int j = 0; j < modules.length; j++) {
> >> >                    m_factory.removeModule(modules[j]);
> >> >                }
> >> >            }
> >> >            catch (Exception ex) {
> >> >                m_logger.log(Logger.LOG_ERROR,
> >> >                   "Unable to remove " +
> >> > bundle.getInfo().getLocation(), ex);
> >> >            }
> >> >        }
> >> >
> >> > For my special use case - I create temporary files for the jar files
> >> > when running with a non-file system repository - this would enable the
> >> > JarFileX.close() method to remove the temporary files.
> >> >
> >> > Regards
> >> > Felix
> >> >
> >>
> >
>

Mime
View raw message