[MGNLGROOVY-179] Groovy Classes representing Servlet or Filter are not reloaded upon scripts changed Created: 01/Apr/19 Updated: 05/Apr/19 Resolved: 02/Apr/19 |
|
| Status: | Closed |
| Project: | Magnolia Groovy Module |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Viet Nguyen | Assignee: | Federico Grilli |
| Resolution: | Not an issue | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 3h | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Documentation update required: |
Yes
|
| Date of First Response: | |
| Sprint: | Foundation 7 |
| Story Points: | 1 |
| Description |
|
Reproduce steps:
-> Expected result is that our Groovy Class Loader will reload the classes upon scripts changed. |
| Comments |
| Comment by Federico Grilli [ 01/Apr/19 ] |
|
Looks like |
| Comment by Federico Grilli [ 02/Apr/19 ] |
|
viet.nguyen I think I know why this doesn't work. It is no regression and it has to do with the fact that in this case we're dealing with http filters and servlets. Those managed by Magnolia (and not by the web container) are (re-)instantiated and initialised only when some change occurs under /config/server/filters which will trigger ServletDispatchingFilter#newServletInstance and eventually ObjectManufacturer#newInstance(java.lang.Class<?>, info.magnolia.objectfactory.ParameterResolver...) In other cases, like a model class or a component, ComponentProvider will try to re-instantiate the class anytime it is needed, for instance when the page or the app where it is used is reloaded. |
| Comment by Federico Grilli [ 02/Apr/19 ] |
|
jlegendre/docu team: maybe worth adding explicitly to the Groovy module documentation the special case of Groovy scripts acting as Servlets and Filters. Grazie! |
| Comment by Viet Nguyen [ 03/Apr/19 ] |
|
Thanks fgrilli, It works follow your suggestion. Cheers, |
| Comment by Julie Legendre [ 05/Apr/19 ] |