Hi Steinar,

You can create a controller for instance by leveraging event admin (to
send an event triggering the reload, and the bundle decides what he
wants to reload). Pros, you control exactly what you want to reload.
Cons, you need to implement your Event handler.
Another option would be to define a dependency between components (via
@Reference). That's probably the cleaner option, but it will do a full
refresh.

Regards
JB

On Fri, Mar 15, 2024 at 5:37 PM Steinar Bang <s...@dod.no> wrote:
>
> I have this bundle:
>  https://github.com/steinarb/oldalbum/tree/master/oldalbum.web.security
>
> which contains two DS/SCR components:
>
>  1. A component implementing ServletContextHelper used to define the
>     servlet context
>      
> https://github.com/steinarb/oldalbum/blob/master/oldalbum.web.security/src/main/java/no/priv/bang/oldalbum/web/security/OldAlbumServletContextHelper.java
>
>  2. A component implementing a Shiro servlet Filter
>      
> https://github.com/steinarb/oldalbum/blob/master/oldalbum.web.security/src/main/java/no/priv/bang/oldalbum/web/security/OldAlbumShiroFilter.java#L35
>
> I would like to reload the shiro servlet filter programmatically when
> its configuration changes.
>
> What's the best way of doing that?
>
> Reload the entire bundle?
>
> Reload just the filter component?
>
> Make the filter reinitialize itself without reloading?
>
> Has anyone done anything similar?
>
> Suggestions? Ideas? All are welcome!
>
> Thanks!
>
>
> - Steinar
>

Reply via email to