Topic: Take a reference (How to design a framework like schedule?) |
Print this page |
1.Take a reference (How to design a framework like schedule?) | Copy to clipboard |
Posted by: jam Posted on: 2003-04-24 09:08 How to design a framework like schedule? The purpose is will have main class like schedule, It will according xml definetion to do some thing. Ex: AM 10 must use DemoSchedule class, DemoSchedule maybe to check somwthing with database, AM 11 must use Demo2Schedule class to produce some report from database, AM 12 must to send mail by another class, How to think and design ? The xml is base structure like that example. <?xml version="1.0" encoding="Big5" standalone="no" ?> <!DOCTYPE ScheduleWork SYSTEM "Schedule.dtd"> <ScheduleWork> <!-- Define Work --> <Schedule> <Classname>DemoSchedule</Classname><!-- Class Name --> <Hour>10</Hour><!-- Running time, ex: am 10 --> <Frequency>1</Frequency><!-- How many times need to run --> <DBCondition></DBCondition><!-- Include Database Condition --> <Log>LogName</Log><!-- log file of message --> </Schedule> <!-- Define Work --> <Schedule> <Classname>Demo2Schedule</Classname><!-- Class Name --> <Hour>11</Hour><!-- Running time, ex: am 11 --> <Frequency>1</Frequency><!-- How many times need to run --> <DBCondition></DBCondition><!-- Include Database Condition --> <Log>LogName</Log><!-- log file of message --> </Schedule> <!-- Define Work --> <Schedule/> </ScheduleWork> <?xml version="1.0" encoding="Big5" ?> <!ELEMENT ScheduleWork (Schedule*)> <!ELEMENT Schedule (Classname, Hour+, Frequency*, DBCondition?, Log?)> <!ELEMENT Classname (#PCDATA)> <!ELEMENT Hour (#PCDATA)> <!ELEMENT Frequency (#PCDATA)> <!ELEMENT DBCondition (#PCDATA)> <!ELEMENT Log (#PCDATA)> |
2.Re:Take a reference [Re: jam] | Copy to clipboard |
Posted by: jam Posted on: 2003-04-25 18:26 I think no people are interesting about this. But I still provide my solution. the attach file is the source. The author is me. If you think this sample is not too bad, give me a point. One thing, I need to finish, what's different of Class.forname and ClassLoad example.zip (4.29k) |
3.Re:Take a reference [Re: jam] | Copy to clipboard |
Posted by: floater Posted on: 2003-04-28 23:46 Will take a look later today. Looks like a good one. |
4.Re:Take a reference [Re: jam] | Copy to clipboard |
Posted by: floater Posted on: 2003-04-29 07:59 java.lang.ArrayIndexOutOfBoundsException: 0 at com.jam.schedule.TriggerSchedule.main(TriggerSchedule.java:47) Exception in thread "main" |
5.Re:Take a reference [Re: floater] | Copy to clipboard |
Posted by: jam Posted on: 2003-04-29 17:18 floater wrote: Please, try again. Thanks. I wish you like it. I need it. Schedule.xml and Schedule.dtd must at System.getProperty("user.dir") example.zip (4.27k) |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |