Temporarily disable events or listeners in code?

Is there a simple way to disable an event or a listener temporarily, and then re-enabling on completion (or in the finally block)?

Thanks, Bruce.

1 votes

1 answers

2592 views

ANSWER



Hi,

You should be able to disable/enable your listeners with the EventServiceAdmin#setListenerEnabledFlag service.

And you may ensure that you re-enabled them using a finally block.

1 votes