04、IntrospectorCleanupListener
来源:互联网 发布:如何把mac桌面的图标 编辑:程序博客网 时间:2024/05/19 23:25
解决Spring整合其他框架和类库(非Spring托管的Bean,如Struts、quartz)产生的单个内部查看泄露使得整个web应用的类加载器不能进行垃圾回收。
类路径:org.springframework.web.util.IntrospectorCleanupListener;
解决问题:处理由JavaBean Introspector使用而引起的缓冲泄露, 它是一个在web应用关闭时清除JavaBean Introspector的监听器;
使用方法:在web.xml中注册这个listener可以保证在web应用关闭的时候释放掉与这个web应用相关的class loader和由它管理的类;
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
源代码如下:
package org.springframework.web.util;
import java.beans.Introspector;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public class IntrospectorCleanupListener implements ServletContextListener {
public void contextInitialized(ServletContextEvent event) {
}
public void contextDestroyed(ServletContextEvent event) {
Introspector.flushCaches();
}
}
- 04、IntrospectorCleanupListener
- IntrospectorCleanupListener
- IntrospectorCleanupListener
- IntrospectorCleanupListener
- IntrospectorCleanupListener
- IntrospectorCleanupListener类
- IntrospectorCleanupListener 简介
- IntrospectorCleanupListener类
- IntrospectorCleanupListener介绍
- IntrospectorCleanupListener 简介
- IntrospectorCleanupListener 监听器
- IntrospectorCleanupListener 简介
- IntrospectorCleanupListener 简介
- IntrospectorCleanupListener作用
- IntrospectorCleanupListener作用
- IntrospectorCleanupListener作用
- IntrospectorCleanupListener作用
- IntrospectorCleanupListener作用
- jsp到jsp传递中文字符乱码
- sqlite 基本API接口说明
- ACM-汽水瓶(C语言基础题)
- (1)mysql优化之sql性能问题定位
- 在docer上安装apache镜像
- 04、IntrospectorCleanupListener
- 邢台哪个治疗自闭症专业
- 编译SPECCPU2006
- Lua学习之coroutine总结
- Android必知必会--使用shape制作drawable素材
- 自定义textview字体闪烁效果
- ios学习笔记:用xib自定义UITableViewCell的注意事项
- 邢台哪个治自闭症好
- 存储过程中的out,output,return 的使用