public class MyDistributeOnceJobListener extends AbstractDistributeOnceElasticJobListener {
private static final long startTimeoutMills = 3000;
private static final long completeTimeoutMills = 3000;
super(startTimeoutMills, completeTimeoutMills);
@Override
public void doBeforeJobExecutedAtLastStarted(ShardingContexts shardingContexts) {
// do something ...
}
public void doAfterJobExecutedAtLastCompleted(ShardingContexts shardingContexts) {
// do something ...
}
@Override
public String getType() {
return "distributeOnceJobListener";
}