Java 开发笔记2
Java获取参数名称
DefaultParameterNameDiscoverer().getParameterNames(real_bean_type.methods.first())
一些方法
加载的所有的Jar包
(Thread.currentThread().contextClassLoader as Launcher.AppClassLoader).urLs
获取类所在的Jar包
ComponentScan::class.java.protectionDomain.codeSource.location.file
启动参数
-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 {
}
这样就让定时任务实现参数化.
![]() |
作者:NewSea 出处:http://newsea.cnblogs.com/
QQ,MSN:iamnewsea@hotmail.com 如无特别标记说明,均为NewSea原创,版权私有,翻载必纠。欢迎交流,转载,但要在页面明显位置给出原文连接。谢谢。 |