[英]How to cancel ScheduledFuture task from another task and end gracefully?
[英]how to get delegate from ScheduledFuture task
见的源代码org.springframework.scheduling.support.DelegatingErrorHandlingRunnable
这里 。
使用反射
如您所见, delegate
在private
范围内声明,没有getter。 因此访问它的唯一方法是使用reflection
。 但是,如果将其定义为私有且没有getter,则需要有充分的理由来访问它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.