Skip to content

liyang-bsy/LYPlan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#LYPlan

Release under LGPL license, consult your rights before using.

##How to use

XMLs

Setup web.xml like test case:
	<servlet>
		<servlet-name>LYPlan</servlet-name>
		<servlet-class>net.vicp.lylab.util.timer.LYPlan</servlet-class>
		<load-on-startup>10</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>LYPlan</servlet-name>
		<url-pattern>/LYPlan/LYPlan</url-pattern>
	</servlet-mapping>

Setup your timer jobs like below in applicationContext.xml:
	<bean name="testjob" class="***.***.timer.Testjob" scope="prototype" />
 
Setup Plan as beans like below in applicationContext.xml:
	<bean name="plan" class="net.vicp.lylab.util.timer.Plan" scope="prototype">
		<property name="jobs">
			<list>
				<ref bean="testjob" /> <!-- and reference your job here! -->
			</list>
		</property>
	</bean>

Java

extends TimerJob and complete some methods:

1.Tell Plan when this job start to work.

public Date getStartTime();

2.Tell Plan how long should this job work again

public Integer getInterval();

3.Override this method to perform your task!

public void run();

Reading Finished? Freak out!

Thanks for reading this document and using my source!

About

LYPlan with test case, release under LGPL license.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages