filter.destroy() 方法的 api 对 servlet 的描述

filter.destroy() method's api description of servlet

当我在寻找 filter.destroy() 方法的 api servlet 描述时,我找到了如下描述 "This method gives the filter an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the filter's current state in memory."

但我不明白"make sure that any persistent state is synchronized with the filter's current state in memory"是什么意思,持久状态和过滤器的当前状态是什么意思?

ps:而且好像在servlet的destroy()方法中也提到了这个描述

谢谢

这意味着它将清除存储在内存中的与过滤器相关的所有数据,例如允许的 url 列表、要阻止的 url 列表、必须应用某些处理的 url 列表等. 有时它需要有用户安全上下文来采取行动(即是否阻止或允许)所有这些东西将在过滤器销毁期间被释放。