定制类加载器有什么特殊的好处?

定制类加载器有什么特殊的好处?

刚才看eddiegift的博客(http://eddiegift.iteye.com/blog/172271),他写一个类加载器.以前一直没弄过这方面的代码,也不知道这样的类加载器有什么特殊的好处,那如何在实际中让JVM用自写的类加载器而不用JVM提供的类加载器呢?

写这里想起来了些这方面的应用,前些天看Spring In Action里的AOP时,有下面一段:
    The weaving can take place at several points in the target object’s lifetime:
        ■ Compile time—Aspects are woven in when the target class is compiled. This
        requires a special compiler. AspectJ’s weaving compiler weaves aspects this
        way.
        ■ Classload time—Aspects are woven in when the target class is loaded into the
        JVM. This requires a special ClassLoader that enhances that target class’s
        bytecode before the class is introduced into the application. AspectJ 5’s
        load-time weaving (LTW) support weaves aspects in this way.
        ■ Runtime—Aspects are woven in sometime during the execution of the appli-
        cation. Typically, an AOP container will dynamically generate a proxy object
        that will delegate to the target object while weaving in the aspects. This is
        how Spring AOP aspects are woven.

也就是说可以用自写的类加载器来实现AOP的Weaving,那还有没有别的应用呢?怎么配置来让JVM调用定制的类加载器呢?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值