Monday, August 5, 2013

Spring - Quartz

public class JobDetails {
@Autowired
private HbaseService hbaseService;
public JobDetails() {
}
public void executeJob() {
try {
// Business Logic
} catch (Exception e) {
logger.error("Exception >> ", e);
}
}
}
view raw JobDetails.java hosted with ❤ by GitHub
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">
<bean id="jobDetails" class="xx.xxx.xxxx.admin.quartz.JobDetails" />
<task:scheduler id="scheduler" pool-size="10"/> <!-- pool-size attribute optional -->
<task:scheduled-tasks scheduler="scheduler"> <!-- scheduled job list -->
<task:scheduled ref="jobDetails" method="executeJob" cron="0 * * * * ?"/>
<!-- Add more job here -->
</task:scheduled-tasks>
</beans>
view raw Quartz.xml hosted with ❤ by GitHub

No comments:

Post a Comment