Reboot karaf from java?

2015-11-23 Thread Benson Margulies
Is there a service in Karaf that completely restarts it?

Re: Reboot karaf from java?

2015-11-23 Thread Guillaume Nodet
I've committed a patch from Hiram that does that in Karaf 4. Thought it's not released yet https://github.com/apache/karaf/commit/a47c36b7f00c6b593b7a9b5a018deda4aeca1cc0 2015-11-23 15:52 GMT+01:00 Benson Margulies : > Is there a service in Karaf that completely restarts it? > >

Re: Reboot karaf from java?

2015-11-23 Thread Benson Margulies
On Mon, Nov 23, 2015 at 9:53 AM, Guillaume Nodet wrote: > I've committed a patch from Hiram that does that in Karaf 4. > Thought it's not released yet > > https://github.com/apache/karaf/commit/a47c36b7f00c6b593b7a9b5a018deda4aeca1cc0 > I'm not trying to change the lib directory, I just was hopi

Re: Reboot karaf from java?

2015-11-23 Thread Jean-Baptiste Onofré
You have the SystemService MBean as well. Regards JB On 11/23/2015 03:52 PM, Benson Margulies wrote: Is there a service in Karaf that completely restarts it? -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com

Re: Reboot karaf from java?

2015-11-23 Thread Jean-Baptiste Onofré
By the way, you can also restart bundle 0 (which is the framework ;)). Take a look on system:reboot command, it does: if (force) { if (reboot) { systemService.reboot(time, determineSwipeType()); } else { systemService.halt(time);

Re: Reboot karaf from java?

2015-11-23 Thread Jean-Baptiste Onofré
SystemService is also available as a pure OSGi service. Regards JB On 11/23/2015 04:12 PM, Jean-Baptiste Onofré wrote: You have the SystemService MBean as well. Regards JB On 11/23/2015 03:52 PM, Benson Margulies wrote: Is there a service in Karaf that completely restarts it? -- Jean-Ba

Re: Reboot karaf from java?

2015-11-23 Thread Guillaume Nodet
So you don't need to restart the JVM ? I was assuming the "completely" means restarting the JVM. Else, JB pointed you to the right direction. At the end, it basically comes down to: System.setProperty("karaf.restart", "true"); bundleContext.getBundle(0).stop(); 2015-11-23 15:56 GMT+01:00 Bens

Re: Reboot karaf from java?

2015-11-23 Thread Jean-Baptiste Onofré
The code to restart Karaf (and so the framework) is "wrapped" in the SystemService (in the reboot() method). On 11/23/2015 04:19 PM, Guillaume Nodet wrote: So you don't need to restart the JVM ? I was assuming the "completely" means restarting the JVM. Else, JB pointed you to the right directio

Re: Reboot karaf from java?

2015-11-23 Thread Benson Margulies
Thanks. On Mon, Nov 23, 2015 at 10:25 AM, Jean-Baptiste Onofré wrote: > The code to restart Karaf (and so the framework) is "wrapped" in the > SystemService (in the reboot() method). > > On 11/23/2015 04:19 PM, Guillaume Nodet wrote: > >> So you don't need to restart the JVM ? >> I was assuming