I have a PhaseListener I want to conditionally add to a Lifecycle. When the conditions are right, it successfully uses lifecycle.addPhaseListner(myConditionalListener) and it processes just fine. At the end of that cycle I want to remove that phaseListener with lifecycle.removePhaseListener(myConditionalListener) The code runs but the listener remains until I restart the application.
Since this listner is costly in terms of performance and only needed in a particular set of conditions, I wanted to use removePhaseListener and I have several such conditional listeners. I would prefer if this works or if I need to do something else in addition to this or instead of this, but I can always have a customeListener that did the logic and was always in there and had its own factory but that's a kludge since removePhaseListener is there it should work, yes?
Do you pee on your compost? Does this tiny ad?
global solutions you can do in your home or backyard