如何每天从Java运行任务? [英] How to run a task daily from Java?

查看:114
本文介绍了如何每天从Java运行任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何每天在指定时间(例如上午11:00)使用java.util.Timer运行任务?我使用的是JDK 1.4.2,我知道它很旧,但这是项目所需要的.

How can I run a task daily at a specified time (say 11:00 am) using java.util.Timer? I'm using JDK 1.4.2, I know it's old, but it's what the project requires.

推荐答案

Quartz是在Java环境中调度进程的最著名的解决方案,但是您有很多选择.检查此列表:

Quartz is the most well known solution to schedule processes in Java environments, but you have a lot of options. Check this list:

Quartz 是可以集成的开源作业调度系统几乎可以与任何J2​​EE或J2SE应用程序一起使用或与之一起使用. Quartz可用于创建简单或复杂的时间表.

Quartz is an open source job scheduling system that can be integrated with, or used along side virtually any J2EE or J2SE application. Quartz can be used to create simple or complex schedules.

Jcrontab 旨在与任何项目进行扩展和集成.读取并存储要在文件,数据库或EJB中执行的任务,并提供Web UI和基本的swing GUI.

Jcrontab is designed to be extended and integrated with any project. Reads and stores the tasks to execute in a file, a database or an EJB and provides a web UI and a basic swing GUI.

Essiembre J2EE Scheduler 是用于J2EE应用程序的简单任务调度机制.该库可以视为标准Java API中的Timer和TimerTask类的包装.要执行的任务及其频率的配置是基于XML的.

Essiembre J2EE Scheduler is a simple task scheduling mechanism for J2EE applications. This library can be considered a wrapper around the Timer and TimerTask classes found in the standard Java API. Configuration for tasks to be executed and their frequency is XML-based.

cron4j 是Java 2平台的调度程序,与UNIX cron守护程序非常相似.

cron4j is a scheduler for the Java 2 platform which is very similar to the UNIX cron daemon.

奇怪的工作 的目标是为将企业关键业务流程联系在一起的所有批处理文件和cron作业提供一定的顺序和可见性.

Oddjob's goal is to provide some order and visibility to all the batch files and cron jobs that tie an enterprise's critical business processes together.

支点调度程序 提供了调度程序服务.它基于Turbine随附的TurbineScheduler,但已删除了所有较旧的内容.当前仅完成非持久性调度程序.它从组件配置xml文件加载计划的作业.

Fulcrum Scheduler provides a scheduler service. It is based on the TurbineScheduler provided with Turbine, but all older stuff has been removed. Currently ONLY the non persistent Scheduler is done. It loads scheduled jobs from the component config xml file.

Gos4j -面向Java的目标调度是一种方法根据目标组织处理优先级.

Gos4j -Goal Oriented Scheduling for Java- is a way of organising processing priorities based on goals.

Job Scheduler 是用作恶魔的批处理程序,并可以使用图形用户界面进行控制.作业计划程序将XML配置用于计划的程序,脚本以及任务处理的时间和频率.提供了一个API,可以控制事件并记录到您的作业中.

Job Scheduler is a batch program operating as a demon, and can be controlled using a graphical user interface. The Job Scheduler uses an XML configuration for the scheduled programs, scripts and for the timing and frequency of task processing. An API is available that hands control of events and logging to your jobs.

JDRing 是一种轻量级的Java调度库,它简单而又较小,但仍支持按指定时间间隔,作为一次性事件或具有完全cron类控制的复杂计划的响铃警报.

JDRing is a lightweight Java scheduling library that is simple and small, but still supports ringing alarms at specified intervals, as one-time events, or on complex schedules with full cron-like control.

jBatchEngine 是用Java编写的批处理作业假脱机程序.与Cron这样的时间驱动调度程序相反,jBatchEngine是事件驱动的.

jBatchEngine is a batch job spooler written in Java. In constrast to time driven schedulers like Cron, jBatchEngine is event driven.

MyBatchFramework 是一个旨在简化以下操作的开源轻量级框架:使用Java语言创建容易健壮且易于管理的批处理程序.

MyBatchFramework is an open-source lightweight framework designed to create easily robust and manageable batch programs into the Java language.

Super with SuperScheduler 和SuperWatchdog 是具有丰富功能的Java作业调度程序所有应用程序的GUI.它是平台无关的.成为Linux和Solaris的作业调度程序特别好.它提供了Microsoft Windows Scheduler的超级功能集.它提供事件触发的调度.它可以在分布式环境中安排任务.任务将在网络中的所有计算机中执行一次,并且仅执行一次.所有任务都是假期可调整的.即使每个工作都是待命工作,历史记录也可以很好地跟踪重要任务.它支持国际化.

Super with SuperScheduler and SuperWatchdog is a Java job scheduler with rich GUI for all applications. It is platform neutral. Especially good to be a job scheduler for Linux and Solaris. It provides a super set of functionalities of the Scheduler of Microsoft Windows. It provides event-triggered scheduling. It can schedule tasks in a distributed environment. A task will be executed once and only once among all machines in the network. All tasks are holiday adjustable. Even every job is a STANDBY job, the history will be a good trace for important tasks. It supports Internationalization.

源: Java中的开源作业调度程序

这篇关于如何每天从Java运行任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆