flow
flow copied to clipboard
Add Environment or Condition to PreserveOnRefresh logic to make it works in given environment.
Describe your motivation
In the local environment, if you work with JRebel -or any other hot swapping tool- PreserveOnRefresh annotation becomes a problem. You need to comment it out in Local environment to make hot swapping works and developer must be sure to not commit this file if it is used in any other environment.
Describe the solution you'd like
Spring spEL or some other kind of logic can be implemented. @PreserveOnRefresh(conditional="${anyCondition=true}")
Describe alternatives you've considered
Instead of using the annotation, it might be implemented with Configuration class.
Additional context
Seems like you would end up duplicating this extra condition for every @PreserveOnRefresh in all applications. I wonder if it would make sense to fix this from the opposite direction so that the hot swap tool would clear the cached component instance when redeploying?