Quartz (GUI) graphical interface program----Quartz WEB

Source: Internet
Author: User

Download, set up, and run the Quartz (GUI) graphical interface program----Quartz WEB

First, get the Quartz Web program (Quartz GUI).
Early Quartz framework developers realized that a GUI is required for a certain group of users. A few years ago, a WEB application was created that could be used to manage the Quartz framework. Although after a few years have been quite committed to the development, but have to say, is always broken when the continued. Recently there have been more requests for updates and support for this application, which has again attracted new developers to volunteer their work and keep them constantly updated. This application is known as the Quartz Web program. The Quartz Web program is part of the Quartz Source Library on Opensymphony. It used to be on the SourceForge, but has recently moved to a new home (note: The SourceForge can still be downloaded). The old site is Http://sourceforge.net/projects/quartz, and the new site (including the Quartz Web program) is available in http://www.quartz-scheduler.org/community/ Found on the repository.html.

Currently, there is no binary plate of the Web program, and the standard Quartz download does not include Web programs, so you need to enter Quartz's SVN (Http://svn.terracotta.org/svn/quartz) The WebApp directory under the source tree is the source directory for the Quartz Web, which is downloaded to the Quartz source tree and built using the ANT or Maven build file in the Quartz/webapp directory to build the Web program.

The latest version of the Quartz web uses the struts2+freemarker+ The spring2.5 architecture also uses open source Sitemesh and DWR, and in Web. XML, set up quartz with Org.quartz.ui.web.init.DefinitionInitializer, with the following settings:
<servlet>
<servlet-name>DefinitionInitializer</servlet-name>
<servlet-class>
Org.quartz.ui.web.init.DefinitionInitializer
</servlet-class>
<init-param>
<param-name>definition-file</param-name>
<param-value> (Path_to_definitions_file) </param-value>
<!--
if (Path_to_definitions_file) is the left as such, definitions was loaded from
/web-inf/classes/jobdefinitions.xml
-
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

Second, modify the settings.
Run the Ant or Maven build file under the Quartz/webapp directory to build this WEB program and get a Quartz.war package, but we should modify its default settings before packaging. By default, the Quartz Web is set to memory (non-persisted) storage, If you want to change the data inventory, you need to modify the Quartz settings file quartz.properties, configure JDBC for it (need to DBCP connection pool, so also add commons-dbcp and Commons-pool package) data source or Jndi data.
The following are the various settings for Jobstore:

1. Memory Storage:
Org.quartz.jobStore.misfireThreshold = 60000
Org.quartz.jobStore.class = Org.quartz.simpl.RAMJobStore

2, the JDBC data source (in this case, the Oracle database, the different databases just modify the value of Org.quartz.jobStore.driverDelegateClass to the corresponding database):
Org.quartz.jobStore.misfireThreshold = 60000
Org.quartz.jobStore.class = Org.quartz.impl.jdbcjobstore.JobStoreTX
Org.quartz.jobStore.driverDelegateClass = Org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
#org. Quartz.jobStore.driverDelegateClass = Org.quartz.impl.jdbcjobstore.DB2v7Delegate
Org.quartz.jobStore.dataSource = MyDS
Org.quartz.jobStore.tablePrefix = Qrtz_
Org.quartz.jobStore.isClustered = False
Org.quartz.dataSource.myDS.driver = oracle.jdbc.driver.OracleDriver
Org.quartz.dataSource.myDS.URL = Jdbc:o Racle:thin: @polarbear: 1521:dev
Org.quartz.dataSource.myDS.user = Quartz
Org.quartz.dataSource.myDS.password = Quartz
Org.quartz.dataSource.myDS.maxConnections = 5

3, Jndi data source (in this case, the Oracle database, different databases as long as the value of the modified Org.quartz.jobStore.driverDelegateClass to the corresponding database):
Org.quartz.jobStore.misfireThreshold = 60000
Org.quartz.jobStore.class = Org.quartz.impl.jdbcjobstore.JobStoreTX
Org.quartz.jobStore.driverDelegateClass = Org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
#org. Quartz.jobStore.driverDelegateClass = Org.quartz.impl.jdbcjobstore.DB2v7Delegate
Org.quartz.jobStore.dataSource = MyDS
Org.quartz.jobStore.tablePrefix = Qrtz_
Org.quartz.jobStore.isClustered = False
Org.quartz.dataSource.myDS.jndiURL = Java:comp/env/jdbc/jnditemp

the Quartz Web program sets up logging and automatically loads the job configuration file in the form of a plugin , as follows:
1. Log Record plugin:
Org.quartz.plugin.triggHistory.class = Org.quartz.plugins.history.LoggingJobHistoryPlugin

2, The job configuration file is loaded with the plug-in Org.quartz.plugins.xml.JobInitializationPlugin, org.quartz.plugin.jobInitializer.fileNames specifies the job assignment under Classpath The name of the file, two plugins configured, three job profiles Jobs.xml, Jobs2.xml,jobs3.xml:

Org.quartz.plugin.jobInitializer.class = Org.quartz.plugins.xml.JobInitializationPlugin
# init plugin would load Jobs.xml as a classpath resource i.e./jobs.xml If not found on file system
Org.quartz.plugin.jobinitializer.filenames=jobs.xml
Org.quartz.plugin.jobInitializer.overWriteExistingJobs = False
Org.quartz.plugin.jobInitializer.failOnFileNotFound = False
Org.quartz.plugin.jobInitializer.scanInterval = 30  
# org.quartz.plugin.jobInitializer.wrapInUserTransaction = True

Org.quartz.plugin.jobInitializerMultiple.class = Org.quartz.plugins.xml.JobInitializationPlugin
# init plugin would load Jobs.xml as a classpath resource i.e./jobs.xml and jobs2.xml if not found on file system
Org.quartz.plugin.jobinitializermultiple.filenames=jobs2.xml,jobs3.xml
Org.quartz.plugin.jobInitializerMultiple.overWriteExistingJobs = False
Org.quartz.plugin.jobInitializerMultiple.failOnFileNotFound = False
# org.quartz.plugin.jobInitializerMultiple.wrapInUserTransaction = True

The Quartz Web program uses jobdefinitions.xml to load the definition of a common job by default , which defines three Quartz built-in jobs, respectively:
Org.quartz.jobs.NativeJob
Org.quartz.jobs.NoOpJob
Org.quartz.jobs.ee.mail

Here are the various jobs built into the quartz:

Job class Job usage
Org.quartz.jobs.FileScanJob Checks whether a specified file has changed and
Notification to the appropriate listener when the piece is changed
Org.quartz.jobs.FileScanListener Notifies the Filescanjob listener when a file has been modified
Org.quartz.jobs.NativeJob Job used to execute a local program, such as an. exe file under Windows
Org.quartz.jobs.NoOpJob Do nothing, but it is not very useful to test the listener.
Some users even use it only to cause a listener to run
Org.quartz.jobs.ee.mail.SendMailJob Job to send e-mail using the JavaMail API
Org.quartz.jobs.ee.jmx.JMXInvokerJob Job that calls methods on JMX beans
Org.quartz.jobs.ee.ejb.EJBInvokerJob The Job used to invoke methods on the EJB

third, the Operation . Deploy the packaged war package to the service, access the Http://localhost:8080/quartz, and then use the default user name: Quartz password: Quartz login to enter the system. The user name and password can be modified in Applicationcontext.xml, as follows:
<bean id= "Authenticator" class= "Org.quartz.ui.web.security.SimpleAuthenticator" >
<property name= "username" >
<value>quartz</value>
</property>
<property name= "Password" >
<value>quartz</value>
</property>
</bean>

Screenshot of Quartz Web program

1. The top left of the Quartz Web program's main interface shows a list of features it has


2. Scheduler Control interface allows you to start, stop, and pause Scheduler

Iv. integration with existing Web programs (I've combined, it works).
We can also add the quartz Web to an existing Web application, as follows:
1. Copy all the jar packages and Settings files and page files of the quartz Web to the existing Web project.
2. Merging the settings files (mainly: Web. XML, Struts.xml and Applicationcontext.xml, etc.)
3, modify the Quartz Web program access to the namespace.
4, Quartz the Web is not perfect, there are many obvious errors, a lot of pages have errors need to be modified to successfully configure each schedule through the GUI

Quartz (GUI) graphical interface program----Quartz WEB

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.