DerekYRC / DerekYRC/mini-spring

只配置了init-destroy属性的代理对象无法找到销毁方法

Open
#95 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.4k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

前提条件:一个bean,需要被代理,并且走的是Jdk动态代理。没有实现DisposableBean的接口,但是添加了自定义销毁的配置init-destroy。

初始化之后,会在BeanPostProcessor的后置增强方法中创建一个代理对象!但是由于init-destory不属于接口中的方法,所以代理对象大概率是找不到该方法的!那么在DisposableBeanAdapter类中就找不到该类的销毁方法,导致无法执行

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the JDK dynamic proxy creation in the BeanPostProcessor path and then read DisposableBeanAdapter to see how the configured destroy method is located. Reproduce the case with a proxied bean that uses only custom init-destroy configuration; done means its configured destroy method is found and invoked despite not being declared on the proxy interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.