Source Code Cross Referenced for QuartzConnector.java in  » ESB » mule » org » mule » transport » quartz » 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 » mule » org.mule.transport.quartz 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: QuartzConnector.java 10489 2008-01-23 17:53:38Z dfeist $
003:         * --------------------------------------------------------------------------------------
004:         * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
005:         *
006:         * The software in this package is published under the terms of the CPAL v1.0
007:         * license, a copy of which has been included with this distribution in the
008:         * LICENSE.txt file.
009:         */
010:
011:        package org.mule.transport.quartz;
012:
013:        import org.mule.api.MuleException;
014:        import org.mule.api.lifecycle.InitialisationException;
015:        import org.mule.api.transport.ConnectorException;
016:        import org.mule.config.i18n.CoreMessages;
017:        import org.mule.transport.AbstractConnector;
018:
019:        import java.util.Properties;
020:
021:        import org.quartz.Scheduler;
022:        import org.quartz.SchedulerFactory;
023:        import org.quartz.impl.StdSchedulerFactory;
024:
025:        /**
026:         * Creates a connection to a Quartz sheduler. This allows events to be sheduled at
027:         * specific times, with repeated occurences.
028:         */
029:        public class QuartzConnector extends AbstractConnector {
030:
031:            public static final String QUARTZ = "quartz";
032:
033:            public static final String PROPERTY_CRON_EXPRESSION = "cronExpression";
034:            public static final String PROPERTY_REPEAT_INTERVAL = "repeatInterval";
035:            public static final String PROPERTY_REPEAT_COUNT = "repeatCount";
036:            public static final String PROPERTY_START_DELAY = "startDelay";
037:            public static final String PROPERTY_PAYLOAD = "payload";
038:            public static final String PROPERTY_JOB_DISPATCH_ENDPOINT = "jobDispatchEndpoint";
039:            public static final String PROPERTY_JOB_RECEIVE_ENDPOINT = "jobReceiveEndpoint";
040:            public static final String PROPERTY_JOB_RECEIVE_TIMEOUT = "jobReceiveTimeout";
041:            /** deprecated: use PROPERTY_PAYLOAD_REFERENCE */
042:            public static final String PROPERTY_PAYLOAD_CLASS_NAME = "payloadClassName";
043:            public static final String PROPERTY_PAYLOAD_REFERENCE = "payloadRef";
044:            public static final String PROPERTY_GROUP_NAME = "groupName";
045:            public static final String PROPERTY_JOB_GROUP_NAME = "jobGroupName";
046:            public static final String PROPERTY_JOB_REF = "jobRef";
047:            public static final String PROPERTY_JOB_CLASS = "jobClass";
048:            public static final String PROPERTY_JOB_OBJECT = "jobObject";
049:
050:            public static final String DEFAULT_GROUP_NAME = "mule";
051:
052:            /**
053:             * Properties to be used for creating the scheduler.  If no properties are given, the
054:             * scheduler will be created by StdSchedulerFactory.getDefaultScheduler()
055:             */
056:            private Properties factoryProperties = null;
057:
058:            /**
059:             * The scheduler instance.  This can be configured by the user and injected as a bean
060:             * or if not, it will be created by Mule upon initialization.
061:             */
062:            private Scheduler quartzScheduler = null;
063:
064:            protected void doInitialise() throws InitialisationException {
065:                try {
066:                    if (quartzScheduler == null) {
067:                        if (factoryProperties != null) {
068:                            SchedulerFactory factory = new StdSchedulerFactory(
069:                                    factoryProperties);
070:                            quartzScheduler = factory.getScheduler();
071:                        } else {
072:                            quartzScheduler = StdSchedulerFactory
073:                                    .getDefaultScheduler();
074:                        }
075:                    }
076:                } catch (Exception e) {
077:                    throw new InitialisationException(CoreMessages
078:                            .initialisationFailure("Quartz provider"), e, this );
079:                }
080:            }
081:
082:            protected void doDispose() {
083:                // template method
084:            }
085:
086:            protected void doConnect() throws Exception {
087:                // template method
088:            }
089:
090:            protected void doDisconnect() throws Exception {
091:                // template method
092:            }
093:
094:            protected void doStart() throws MuleException {
095:                try {
096:                    quartzScheduler.start();
097:                } catch (Exception e) {
098:                    throw new ConnectorException(CoreMessages
099:                            .failedToStart("Quartz provider"), this , e);
100:                }
101:            }
102:
103:            protected void doStop() throws MuleException {
104:                try {
105:                    if (quartzScheduler != null) {
106:                        quartzScheduler.shutdown();
107:                    }
108:                } catch (Exception e) {
109:                    throw new ConnectorException(CoreMessages
110:                            .failedToStop("Quartz provider"), this , e);
111:                }
112:            }
113:
114:            public String getProtocol() {
115:                return QUARTZ;
116:            }
117:
118:            public Scheduler getQuartzScheduler() {
119:                return quartzScheduler;
120:            }
121:
122:            public void setQuartzScheduler(Scheduler scheduler) {
123:                this .quartzScheduler = scheduler;
124:            }
125:
126:            public Properties getFactoryProperties() {
127:                return factoryProperties;
128:            }
129:
130:            public void setFactoryProperties(Properties factoryProperties) {
131:                this.factoryProperties = factoryProperties;
132:            }
133:
134:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.