Java 开发笔记2

Java获取参数名称

https://blog.csdn.net/z69183787/article/details/81117525

DefaultParameterNameDiscoverer().getParameterNames(real_bean_type.methods.first())

启动参数

-Xmx 是VM参数 , 写到 jar 后面.
-jar 后面 两个减号是 jar 参数. 不能断.

限制线程数量:

java -Dloader.path=jar -Dfile.encoding=utf-8 -Xmx250m -jar xxx.jar --server.undertow.io-threads=16 --server.undertow.worker-threads=32 --server.dbIp=localhost

动态化注解配置.

@Configuration
@EnableScheduling
@ConditionalOnProperty(prefix = "scheduling", name="enabled", havingValue="true", matchIfMissing = true)
public class SchedulerConfig {

}

这样就让定时任务实现参数化.

原文地址:https://www.cnblogs.com/newsea/p/9989180.html