[osgi-dev] Restart OSGi framework programatically

Guillaume Nodet gnodet at gmail.com
Wed Jun 8 12:00:08 EDT 2011


Right, we have the same kind of launcher in Karaf that even enable us
to update the osgi framework itself.

On Wed, Jun 8, 2011 at 17:43, Felix Meschberger <fmeschbe at gmail.com> wrote:
> Hi,
>
> Am Mittwoch, den 08.06.2011, 11:34 -0400 schrieb Richard S. Hall:
>> On 6/8/11 11:20, Felix Meschberger wrote:
>> > Hi,
>> >
>> > Am Mittwoch, den 08.06.2011, 17:12 +0200 schrieb Eugen Reiswich:
>> >> Hi folks,
>> >>
>> >> I need to restart an OSGi application programmatically in Java. How can I do this?
>> > AFAICT the "official" way is to call Bundle.update() on the system
>> > bundle.
>>
>> True.
>>
>> > BUT: This requires support from the framework launcher.
>>
>> Not entirely true.
>
> Yes, I just realized that I remained in the 4.1 times when Peter posted
> his reply.
>
>>
>> If you want to simply restart the framework, then calling update() on
>> the system bundle would be sufficient. However, if you want to restart
>> the JVM (e.g., to change what's on the boot class path) then you need
>> help from the launcher.
>
> In fact, what we do in the Sling launcher is that we create "root" class
> loader to load the framework with and on framework restart we throw away
> the old one and create a new one.
>
> I think this further helps PermGen GC --- but I would be happy to learn
> that I am wrong ;-)
>
> Regards
> Felix
>
>
> _______________________________________________
> OSGi Developer Mail List
> osgi-dev at mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>



-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com


More information about the osgi-dev mailing list