quartzÒ»·ÖÖÓ½Ì³Ì javaÈÎÎñµ÷¶È
quartzÊǸÉɶµÄ£¿ ÈÎÎñµ÷¶ÈÓõÄ
ÈÎÎñµ÷¶ÈÊǸÉɶµÄ£¿¾ÍÊÇÔÚÔ¤¶¨µÄʱ¼ä×öÔ¤¶¨µÄÊÂ
1.ÔÚquartÍøÕ¾ÏÂ×îеÄJAR°ü
2.½¨¸öÏîÄ¿£¬°ÑquartzµÄJAR°ü¼ÓÈëµ½ÏîÄ¿
3.н¨Ò»¸öÈÎÎñ
public class MyJob implements org.quartz.Job {
@Override
public void execute(JobExecutionContext arg0) throws JobExecutionException {
System.out.println("ÎÒ±»µ÷ÓÃÁË");
}
}
4.¿ªÆôÈÎÎñ£º
public class StartSchedule {
public static void main(String[] args) throws Exception {
SchedulerFactory sf = new StdSchedulerFactory();
Scheduler sched = sf.getScheduler();
JobDetail job = new JobDetail("job1", "group1", MyJob.class);
CronTrigger t = new CronTrigger("trigger1", "group1", "job1", "group1", "0/2 * * * * ?");
sched.scheduleJob(job, t);
sched.start();
Thread.sleep(500000);
sched.shutdown(true);
}
}
5.ÔËÐÐStartSchedule¼´¿É
ÆäÖУº
"0/2 * * * * ?" ÊÇcronExpression±í´ïʽ
Ò»¹²ÓÐ7×éÊý¾Ý×é³É£¬Î»Óëλ֮¼äÓÿռä·Ö¸ô
·Ö±ð´ú±í “Ãë ·Ö Ê± ÈÕ Ô ÖÜ Äê” ÆäÖÐÄêÊÇ¿ÉÒÔÊ¡ÂԵģ¬ËùÒÔÔÚÀý×ÓÖÐÓÃÁË6×é
¹Ù·½µÄÀý×Ó£º
Examples
Here are some full examples:
Expression
Meaning
0 0 12 * * ?
Fire at 12pm (noon) every day
0 15 10 ? * *
Fire at 10:15am every day
0 15 10 * * ?
Fire at 10:15am every day
0 15 10 * * ? *
Fire at 10:15am every day
0 15 10 * * ? 2005
Fire at 10:15am every day during the year 2005
0 * 14 * * ?
Fire every minute starting at 2pm and ending at 2:59pm, every day
0 0/5 14 * * ?
Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day
0 0/5 14,18 * * ?
Fire every 5 minutes starting at 2pm and
ending at 2:55pm, AND fire every 5 minutes starting at 6pm and ending
at 6:55pm, every day
0 0-5 14 * * ?
Fire every minute starting at 2pm and ending at 2:05pm, every day
0 10,44 14 ? 3 WED
Fire at 2:10pm and at 2:44pm every Wednesday in the month of March.
0 15 10 ? * MO
Ïà¹ØÎĵµ£º
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
½ñÌìÎÒѧϰÁË·´ÉäÓë¶àÏ̵߳Ä֪ʶ
·´É䣺Class cls1=Date.class//×Ö½ÚÂë1£»
Class cls2=Person.class//×Ö½ÚÂë2£»
P1.getClass();//µÃµ½×Ö½ÚÂë
Class.forName(“java.lang.String”) //µÃµ½Õâ¸öÀàµÄ×Ö½ÚÂë
ºǫ́Ïß³ÌÓëÁªºÏÏß³Ì
l & ......
ת×Ô£ºhttp://blog.csdn.net/felomeng/archive/2009/10/17/4688257.aspx
ÔÚeclipseÏÂʹÓÃjavaµ÷ÓÃweka ÊÕ²Ø
wekaÊǺܺÃÓõĻúÆ÷ѧϰ¿â£¬ÕâÀï¾Í²»Ïêϸ½éÉÜÁË¡£
ÑÔ¹éÕý´«£¬ÒªÊ¹ÓóÌÐò·½Ê½Ê¹ÓÃweka£¬²½ÖèÈçÏ£º
Ò»¡¢ÔÚeclipseÀïн¨Ò»¸öjava project£º
1. ½¨Á¢¹¤³Ì£ºµ¥»÷²Ëµ¥ÖÐfil ......
Â¥Ö÷·¢±íÓÚ£º2008-06-17 15:26:20
l JBS
1.Áоٳö 10¸öJAVAÓïÑÔµÄÓÅÊÆ
a:Ãâ·Ñ£¬¿ªÔ´£¬¿çƽ̨(ƽ̨¶ÀÁ¢ÐÔ)£¬¼òµ¥Ò×Ó㬹¦ÄÜÍêÉÆ£¬ÃæÏò¶ÔÏ󣬽¡×³ÐÔ£¬¶àỊ̈߳¬½á¹¹ÖÐÁ¢£¬ÆóÒµÓ¦ÓõijÉÊìƽ̨, ÎÞÏßÓ¦ÓÃ
2.ÁоٳöJAVAÖÐ10¸öÃæÏò¶ÔÏó±à³ÌµÄÊõÓï
a:°ü£¬À࣬½Ó¿Ú£¬¶ÔÏó£¬ÊôÐÔ£¬·½·¨£¬¹¹ÔìÆ÷ ......
ÔÎÄ£ºDependency Injection in Java EE 6 – Part 1
×÷ÕߣºReza Rahman
³ö´¦£ºhttp://www.theserverside.com/tt/articles/article.tss?l=DependencyInjectioninJavaEE6
ÕâÒ»ÎÄÕÂϵÁнéÉÜÁËJava EEµÄÉÏÏÂÎĺÍÒÀÀµ×¢È루Contexts and Dependency Injection for Java EE£¬CDI£©£¬CDIÊǼ´½«Íê³ÉµÄJava EE 6Æ½Ì ......