1. public class MyDistributeOnceJobListener extends AbstractDistributeOnceElasticJobListener {
  2. private static final long startTimeoutMills = 3000;
  3. private static final long completeTimeoutMills = 3000;
  4. super(startTimeoutMills, completeTimeoutMills);
  5. @Override
  6. public void doBeforeJobExecutedAtLastStarted(ShardingContexts shardingContexts) {
  7. // do something ...
  8. }
  9. public void doAfterJobExecutedAtLastCompleted(ShardingContexts shardingContexts) {
  10. // do something ...
  11. }
  12. @Override
  13. public String getType() {
  14. return "distributeOnceJobListener";
  15. }