Source Code Cross Referenced for StandardSchedule.java in  » ESB » cbesb-1.2 » com » bostechcorp » cbesb » runtime » scheduler » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ESB » cbesb 1.2 » com.bostechcorp.cbesb.runtime.scheduler 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ChainBuilder ESB
003:         * 		Visual Enterprise Integration
004:         * 
005:         * Copyright (C) 2007 Bostech Corporation
006:         * 
007:         * This program is free software; you can redistribute it and/or modify it 
008:         * under the terms of the GNU General Public License as published by the 
009:         * Free Software Foundation; either version 2 of the License, or (at your option) 
010:         * any later version.
011:         *
012:         * This program is distributed in the hope that it will be useful, 
013:         * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
014:         * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
015:         * for more details.
016:         * 
017:         * You should have received a copy of the GNU General Public License along with 
018:         * this program; if not, write to the Free Software Foundation, Inc., 
019:         * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020:         *
021:         *
022:         * $Id: StandardSchedule.java 6905 2007-04-19 03:05:32Z mpreston $
023:         */
024:        package com.bostechcorp.cbesb.runtime.scheduler;
025:
026:        import org.apache.commons.logging.Log;
027:        import org.apache.commons.logging.LogFactory;
028:        import org.jdom.Element;
029:        import org.quartz.CronExpression;
030:
031:        public class StandardSchedule implements  ISchedule {
032:
033:            private Log log = LogFactory.getLog(StandardSchedule.class);
034:            private String seconds;
035:            private String minutes;
036:            private String hours;
037:            private String dayOfMonth;
038:            private String month;
039:            private String dayOfWeek;
040:            private String holidaySchedule;
041:
042:            /**
043:             * @return the dayOfMonth
044:             */
045:            public String getDayOfMonth() {
046:                return dayOfMonth;
047:            }
048:
049:            /**
050:             * @param dayOfMonth the dayOfMonth to set
051:             */
052:            public void setDayOfMonth(String dayOfMonth) {
053:                this .dayOfMonth = dayOfMonth;
054:            }
055:
056:            /**
057:             * @return the dayOfWeek
058:             */
059:            public String getDayOfWeek() {
060:                return dayOfWeek;
061:            }
062:
063:            /**
064:             * @param dayOfWeek the dayOfWeek to set
065:             */
066:            public void setDayOfWeek(String dayOfWeek) {
067:                this .dayOfWeek = dayOfWeek;
068:            }
069:
070:            /**
071:             * @return the holidaySchedule
072:             */
073:            public String getHolidaySchedule() {
074:                return holidaySchedule;
075:            }
076:
077:            /**
078:             * @param holidaySchedule the holidaySchedule to set
079:             */
080:            public void setHolidaySchedule(String holidaySchedule) {
081:                this .holidaySchedule = holidaySchedule;
082:            }
083:
084:            /**
085:             * @return the hours
086:             */
087:            public String getHours() {
088:                return hours;
089:            }
090:
091:            /**
092:             * @param hours the hours to set
093:             */
094:            public void setHours(String hours) {
095:                this .hours = hours;
096:            }
097:
098:            /**
099:             * @return the minutes
100:             */
101:            public String getMinutes() {
102:                return minutes;
103:            }
104:
105:            /**
106:             * @param minutes the minutes to set
107:             */
108:            public void setMinutes(String minutes) {
109:                this .minutes = minutes;
110:            }
111:
112:            /**
113:             * @return the month
114:             */
115:            public String getMonth() {
116:                return month;
117:            }
118:
119:            /**
120:             * @param month the month to set
121:             */
122:            public void setMonth(String month) {
123:                this .month = month;
124:            }
125:
126:            /**
127:             * @return the seconds
128:             */
129:            public String getSeconds() {
130:                return seconds;
131:            }
132:
133:            /**
134:             * @param seconds the seconds to set
135:             */
136:            public void setSeconds(String seconds) {
137:                this .seconds = seconds;
138:            }
139:
140:            public CronExpression getCronExpression() throws Exception {
141:                String cronStr = seconds + " " + minutes + " " + hours + " "
142:                        + dayOfMonth + " " + month + " " + dayOfWeek;
143:                CronExpression cronExpr = new CronExpression(cronStr);
144:                return cronExpr;
145:            }
146:
147:            /* (non-Javadoc)
148:             * @see com.bostechcorp.cbesb.runtime.scheduler.ISchedule#fromJDomElement()
149:             */
150:            public boolean fromJDomElement(Element standSchedElem,
151:                    ComponentSchedule compSched) {
152:                String value = compSched.getChildTextValue(standSchedElem,
153:                        ComponentSchedule.SECONDS);
154:                if (value != null) {
155:                    setSeconds(value);
156:                } else {
157:                    log.error("StandardSchedule - Unable to load value of '"
158:                            + ComponentSchedule.SECONDS + "'");
159:                    return false;
160:                }
161:                value = compSched.getChildTextValue(standSchedElem,
162:                        ComponentSchedule.MINUTES);
163:                if (value != null) {
164:                    setMinutes(value);
165:                } else {
166:                    log.error("StandardSchedule - Unable to load value of '"
167:                            + ComponentSchedule.MINUTES + "'");
168:                    return false;
169:                }
170:                value = compSched.getChildTextValue(standSchedElem,
171:                        ComponentSchedule.HOURS);
172:                if (value != null) {
173:                    setHours(value);
174:                } else {
175:                    log.error("StandardSchedule - Unable to load value of '"
176:                            + ComponentSchedule.HOURS + "'");
177:                    return false;
178:                }
179:                value = compSched.getChildTextValue(standSchedElem,
180:                        ComponentSchedule.DAY_OF_MONTH);
181:                if (value != null) {
182:                    setDayOfMonth(value);
183:                } else {
184:                    log.error("StandardSchedule - Unable to load value of '"
185:                            + ComponentSchedule.DAY_OF_MONTH + "'");
186:                    return false;
187:                }
188:                value = compSched.getChildTextValue(standSchedElem,
189:                        ComponentSchedule.MONTH);
190:                if (value != null) {
191:                    setMonth(value);
192:                } else {
193:                    log.error("StandardSchedule - Unable to load value of '"
194:                            + ComponentSchedule.MONTH + "'");
195:                    return false;
196:                }
197:                value = compSched.getChildTextValue(standSchedElem,
198:                        ComponentSchedule.DAY_OF_WEEK);
199:                if (value != null) {
200:                    setDayOfWeek(value);
201:                } else {
202:                    log.error("StandardSchedule - Unable to load value of '"
203:                            + ComponentSchedule.DAY_OF_WEEK + "'");
204:                    return false;
205:                }
206:                value = compSched.getChildTextValue(standSchedElem,
207:                        ComponentSchedule.HOLIDAY_SCHEDULE);
208:                if (value != null) {
209:                    setHolidaySchedule(value);
210:                }
211:
212:                return true;
213:
214:            }
215:
216:            /* (non-Javadoc)
217:             * @see com.bostechcorp.cbesb.runtime.scheduler.ISchedule#toJDomElement()
218:             */
219:            public Element toJDomElement(ComponentSchedule compSched) {
220:                Element standSchedElem = compSched
221:                        .createElement(ComponentSchedule.STANDARD_SCHEDULE);
222:
223:                Element childElem = compSched
224:                        .createElement(ComponentSchedule.SECONDS);
225:                childElem.setText(seconds);
226:                standSchedElem.addContent(childElem);
227:
228:                childElem = compSched.createElement(ComponentSchedule.MINUTES);
229:                childElem.setText(minutes);
230:                standSchedElem.addContent(childElem);
231:
232:                childElem = compSched.createElement(ComponentSchedule.HOURS);
233:                childElem.setText(hours);
234:                standSchedElem.addContent(childElem);
235:
236:                childElem = compSched
237:                        .createElement(ComponentSchedule.DAY_OF_MONTH);
238:                childElem.setText(dayOfMonth);
239:                standSchedElem.addContent(childElem);
240:
241:                childElem = compSched.createElement(ComponentSchedule.MONTH);
242:                childElem.setText(month);
243:                standSchedElem.addContent(childElem);
244:
245:                childElem = compSched
246:                        .createElement(ComponentSchedule.DAY_OF_WEEK);
247:                childElem.setText(dayOfWeek);
248:                standSchedElem.addContent(childElem);
249:
250:                if (holidaySchedule != null) {
251:                    childElem = compSched
252:                            .createElement(ComponentSchedule.HOLIDAY_SCHEDULE);
253:                    childElem.setText(holidaySchedule);
254:                    standSchedElem.addContent(childElem);
255:                }
256:
257:                return standSchedElem;
258:            }
259:
260:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.