Source Code Cross Referenced for SchedulerMessage.java in  » ESB » cbesb-1.2 » com » bostechcorp » cbesb » runtime » ccsl » messages » 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.ccsl.messages 
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: SchedulerMessage.java 9243 2007-09-25 00:49:54Z lzheng $
023:         */
024:        package com.bostechcorp.cbesb.runtime.ccsl.messages;
025:
026:        import java.util.HashMap;
027:        import java.util.Iterator;
028:        import java.util.List;
029:
030:        import javax.xml.namespace.QName;
031:        import javax.xml.transform.Source;
032:        import javax.xml.transform.Transformer;
033:        import javax.xml.transform.TransformerFactory;
034:        import javax.xml.transform.dom.DOMResult;
035:        import javax.xml.transform.dom.DOMSource;
036:
037:        import org.apache.commons.logging.Log;
038:        import org.apache.commons.logging.LogFactory;
039:        import org.jdom.Namespace;
040:        import org.w3c.dom.Document;
041:        import org.w3c.dom.Element;
042:        import org.w3c.dom.Node;
043:
044:        public abstract class SchedulerMessage {
045:
046:            public static final String SCHEDULER_NS = "http://cbesb.bostechcorp.com/wsdl/scheduler/1.0";
047:            public static final String SUBMIT_SCHEDULE = "submitSchedule";
048:            public static final String SUBMIT_SCHEDULE_RESPONSE = "submitScheduleResponse";
049:            public static final String REMOVE_SCHEDULE = "removeSchedule";
050:            public static final String REMOVE_SCHEDULE_RESPONSE = "removeScheduleResponse";
051:            public static final String TRIGGER_ENDPOINT = "triggerEndpoint";
052:            public static final String JOB_ENDPOINT = "jobEndpoint";
053:            public static final String SCHEDULES = "schedules";
054:            public static final String STANDARD_SCHEDULE = "standardSchedule";
055:            public static final String AUTO_RETRY_SCHEDULE = "standardSchedule";
056:            public static final String SUCCESS = "success";
057:            public static final String SERVICE_NAME = "serviceName";
058:            public static final String ENDPOINT_NAME = "endpointName";
059:            public static final String SECONDS = "seconds";
060:            public static final String MINUTES = "minutes";
061:            public static final String HOURS = "hours";
062:            public static final String DAY_OF_MONTH = "dayOfMonth";
063:            public static final String MONTH = "month";
064:            public static final String DAY_OF_WEEK = "dayOfWeek";
065:            public static final String HOLIDAY_SCHEDULE = "holidaySchedule";
066:            public static final String START_TIME = "startTime";
067:            public static final String END_TIME = "endTime";
068:            public static final String RETRY_INTERVAL = "retryInterval";
069:            public static final String SUCCESS_NOTIFICATION_EP = "successNotificationEP";
070:            public static final String FAILURE_NOTIFICATION_EP = "failureNotificationEP";
071:            public static final String STANDARD_TRIGGER = "standardTrigger";
072:            public static final String AUTO_RETRY_TRIGGER = "autoRetryTrigger";
073:            public static final String AUTO_RETRY_TRIGGER_RESPONSE = "autoRetryTriggerResponse";
074:            public static final String ERROR = "error";
075:            public static final String JOB_STATUS = "jobStatus";
076:
077:            protected static Namespace schedulerNS = Namespace
078:                    .getNamespace(SCHEDULER_NS);
079:
080:            protected Log log = LogFactory.getLog(getClass());
081:
082:            public SchedulerMessage() {
083:
084:            }
085:
086:            public static SchedulerMessage createFromSource(Source src)
087:                    throws Exception {
088:                return null;
089:            }
090:
091:            public Source toSource() throws Exception {
092:                return null;
093:            }
094:
095:            public abstract QName getMessageType();
096:
097:            protected static Document getDocFromSource(Source originalSource)
098:                    throws Exception {
099:                Node domNode;
100:                if (originalSource instanceof  DOMSource) {
101:                    domNode = ((DOMSource) originalSource).getNode();
102:                } else {
103:                    DOMResult dr = new DOMResult();
104:                    TransformerFactory tf = TransformerFactory.newInstance();
105:                    Transformer t = tf.newTransformer();
106:                    t.transform(originalSource, dr);
107:                    domNode = dr.getNode();
108:                }
109:                if (domNode instanceof  Document) {
110:                    return (Document) domNode;
111:                } else {
112:                    return ((Element) domNode).getOwnerDocument();
113:                }
114:            }
115:
116:            protected static HashMap<String, Namespace> getNamespaceMap(
117:                    org.jdom.Element rootElement) {
118:                HashMap<String, Namespace> nsMap = new HashMap<String, Namespace>();
119:                nsMap.put(rootElement.getNamespace().getPrefix(), rootElement
120:                        .getNamespace());
121:                List nsDecls = rootElement.getAdditionalNamespaces();
122:                for (Iterator iter = nsDecls.iterator(); iter.hasNext();) {
123:                    Namespace ns = (Namespace) iter.next();
124:                    nsMap.put(ns.getPrefix(), ns);
125:                }
126:                return nsMap;
127:            }
128:
129:            protected static QName getQNameFromPrefixedName(
130:                    String prefixedName, HashMap<String, Namespace> nsMap) {
131:                String prefix;
132:                String localName;
133:                QName qname;
134:                int index = prefixedName.indexOf(':');
135:                if (index > 0) {
136:                    prefix = prefixedName.substring(0, index);
137:                    localName = prefixedName.substring(index + 1);
138:                } else {
139:                    prefix = null;
140:                    localName = prefixedName;
141:                }
142:                Namespace ns = nsMap.get(prefix);
143:                if (ns != null) {
144:                    qname = new QName(ns.getURI(), localName);
145:                } else {
146:                    qname = null;
147:                }
148:                return qname;
149:            }
150:
151:            protected static String getPrefixedNameFromQName(QName qname,
152:                    HashMap<String, Namespace> nsMap) {
153:                String prefix;
154:                Namespace ns;
155:                if (!nsMap.containsKey(qname.getNamespaceURI())) {
156:                    prefix = "q" + nsMap.size();
157:                    ns = Namespace
158:                            .getNamespace(prefix, qname.getNamespaceURI());
159:                    nsMap.put(qname.getNamespaceURI(), ns);
160:                } else {
161:                    ns = nsMap.get(qname.getNamespaceURI());
162:                    prefix = ns.getPrefix();
163:                }
164:
165:                return prefix + ":" + qname.getLocalPart();
166:            }
167:
168:            protected static void addNamespaceDeclsToRoot(
169:                    org.jdom.Element rootElem, HashMap<String, Namespace> nsMap) {
170:                for (Iterator iter = nsMap.keySet().iterator(); iter.hasNext();) {
171:                    String key = (String) iter.next();
172:                    Namespace ns = nsMap.get(key);
173:                    rootElem.addNamespaceDeclaration(ns);
174:                }
175:            }
176:
177:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.