Cron syntax with Java EE 5?
-
24-09-2019 - |
문제
Timer Tasks in Java EE are not very comfortable. Is there any util, to configure timer with cron syntax like "0 20 20 * * "?
I wonder, if it would be a good way to use Quartzinside (clustered) Java EE application. According to http://www.prozesse-und-systeme.de/serverClustering.html (german page) there limits with Quartz and Java EE clustering:
- JDBC must be used as job store for Quartz
- Only cluster associated Quartz instances are allowed to use this JDBC job store
- All cluster nodes must be synchronized to the split second
- All cluster nodes must use the same quartz.properties file
I would prefer an easier way for configuration of timer service, instead an not Java EE managed scheduler.
해결책
예, 가능합니다.그러나 코드에서 OOP 생성자는 볼 수 없습니다. 함수로 호출합니다.
문제는 이벤트 리스너를 추가하려고 할 때 ID가없는 요소가 없거나 create
메서드에 대한 호출을 덮어 씁니다.
이 옵션을 사용하십시오 :
function MenuItem(name){
this.menu_name = name;
this.create = function() {
var el = $("<div id=" + menu_name + " />");
el.on('click',function(){
alert (menu_name);
});
$('body').append(el);
};
}
var menu = new MenuItem("test");
menu.create();
. 제휴하지 않습니다 StackOverflow