最佳答案
查看org.springframework.scheduling.support.DelegatingErrorHandlingRunnable
的源代码here 。
使用反射
如您所见,delegate
是在 private
范围内声明的,没有 getter。因此访问它的唯一方法是使用反射。但是,如果它被定义为私有(private)且没有 getter,则您需要有充分的理由需要访问它。
关于java - 如何从 ScheduledFuture 任务获取委托(delegate),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55047346/