Search in sources :

Example 1 with DemoService

use of com.vip.saturn.demo.service.DemoService in project Saturn by vipshop.

the class DemoJob method handleJavaJob.

@Override
public SaturnJobReturn handleJavaJob(String jobName, Integer shardItem, String shardParam, SaturnJobExecutionContext shardingContext) throws InterruptedException {
    DemoService demoService = (DemoService) SpringFactory.getInstance().getObject("demoService");
    demoService.execute();
    System.out.println("我会出现在运行日志里.running handleJavaJob:" + jobName + "; " + shardItem + ";" + shardParam);
    return new SaturnJobReturn("我是分片" + shardItem + "的处理结果");
}
Also used : SaturnJobReturn(com.vip.saturn.job.SaturnJobReturn) DemoService(com.vip.saturn.demo.service.DemoService)

Aggregations

DemoService (com.vip.saturn.demo.service.DemoService)1 SaturnJobReturn (com.vip.saturn.job.SaturnJobReturn)1