|
|
@ -94,35 +94,22 @@
|
|
|
|
<textarea id="demoCode" style="display:none;" >
|
|
|
|
<textarea id="demoCode" style="display:none;" >
|
|
|
|
package com.xxl.job.service.handler;
|
|
|
|
package com.xxl.job.service.handler;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.xxl.job.client.handler.IJobHandler;
|
|
|
|
import com.xxl.job.client.handler.IJobHandler;
|
|
|
|
import com.xxl.job.client.handler.IJobHandler.JobHandleStatus;
|
|
|
|
import com.xxl.job.client.handler.IJobHandler.JobHandleStatus;
|
|
|
|
import com.xxl.job.client.handler.annotation.JobHander;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class DemoJobHandler extends IJobHandler {
|
|
|
|
public class DemoJobHandler extends IJobHandler {
|
|
|
|
private static transient Logger logger = LoggerFactory.getLogger(DemoJobHandler.class);
|
|
|
|
private static transient Logger logger = LoggerFactory.getLogger(DemoJobHandler.class);
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public JobHandleStatus handle(String... params) throws Exception {
|
|
|
|
public JobHandleStatus handle(String... params) throws Exception {
|
|
|
|
for (int i = 0; i < 5; i++) {
|
|
|
|
logger.info("XXL-JOB, Hello World.");
|
|
|
|
TimeUnit.SECONDS.sleep(1);
|
|
|
|
|
|
|
|
logger.info("handler run:{}", i);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return JobHandleStatus.SUCCESS;
|
|
|
|
return JobHandleStatus.SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
|
|
System.out.println(DemoJobHandler.class.getName());
|
|
|
|
|
|
|
|
System.out.println(DemoJobHandler.class);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</textarea>
|
|
|
|
</textarea>
|
|
|
|
|
|
|
|
|
|
|
|
<@netCommon.comAlert />
|
|
|
|
<@netCommon.comAlert />
|
|
|
|