It is not possible to reload a weaving hook without restarting affected
bundles because in order for the weaving to act the classloader has to be
thrown away and recreated with the hook in place.

Sincerely,
- Ray

On Mon, Aug 10, 2020 at 11:21 AM Roy Teeuwen <r...@teeuwen.be> wrote:

> Trying it out here if there may be more response
>
> > Begin forwarded message:
> >
> > From: Roy Teeuwen <r...@teeuwen.be>
> > Subject: Updating OSGI weaving hooks at runtime
> > Date: 5 August 2020 at 08:49:09 CEST
> > To: Apache Felix Developer List <d...@felix.apache.org>
> >
> > Hey devs,
> >
> > I found a repo with some weaving hooks examples (
> https://github.com/bdelacretaz/OSGi-weaving-hook-examples/blob/master/src/main/java/ch/x42/osgi/weavinghook/LogMethodCallsHook.java
> <
> https://github.com/bdelacretaz/OSGi-weaving-hook-examples/blob/master/src/main/java/ch/x42/osgi/weavinghook/LogMethodCallsHook.java>,
> even though it is pretty old) and found it interesting. What I would like
> to try out is to mimick the behaviour of Rookout (
> https://www.rookout.com/ <https://www.rookout.com/> ). Rookout allows
> (read-only) debugging of a production instance by adding a java agent that
> is able to get object field values at runtime without attaching a real java
> remote debugging instance.
> >
> > How I would like to mimick this is by creating an OSGi Weaving Hook,
> based on the LogMethodCallsHook class, that would allow you to create an
> OSGi weaving hook at runtime by creating for example an OSGi configuration
> factory that registers a weaving hook for a class with a method in a
> specific bundle. Do you see this feasible? Is it possible to register a
> weaving hook without having to reload the entire bundle again and going
> through the Activator method again?
> >
> > I already had a comment from the repo owner himself and he doesn’t think
> its feasable but he gave me the remark to ask here as well! (
> https://github.com/bdelacretaz/OSGi-weaving-hook-examples/issues/1 <
> https://github.com/bdelacretaz/OSGi-weaving-hook-examples/issues/1>)
> >
> > Thanks!
> > Roy
>
>

-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)

Reply via email to