MCPcopy Create free account
hub / github.com/e2wugui/zeze / cronEquals

Method cronEquals

ZezeJava/ZezeJava/src/main/java/Zeze/Component/Timer.java:707–733  ·  view source on GitHub ↗
(@NotNull BIndex index, @NotNull String timerId, @NotNull String cron, long times,
							  long endTime, int missfirePolicy, @NotNull Class<? extends TimerHandle> handleClass,
							  @Nullable Bean customData, @NotNull String oneByOneKey)

Source from the content-addressed store, hash-verified

705 }
706
707 public boolean cronEquals(@NotNull BIndex index, @NotNull String timerId, @NotNull String cron, long times,
708 long endTime, int missfirePolicy, @NotNull Class<? extends TimerHandle> handleClass,
709 @Nullable Bean customData, @NotNull String oneByOneKey) {
710 if (timerFutures.containsKey(timerId)) { // 在调度中
711 var root = _tNodeRoot.get(zeze.getConfig().getServerId());
712 if (root != null) {
713 var node = _tNodes.get(index.getNodeId());
714 if (node != null) {
715 var timer = node.getTimers().get(timerId);
716 if (timer != null
717 && timer.getHandleName().equals(handleClass.getName())
718 && timer.getCustomData().getBean().equals(customData)) {
719 var timerObj = timer.getTimerObj().getBean();
720 if (timerObj instanceof BCronTimer) {
721 var cronTimer = (BCronTimer)timerObj;
722 return cronTimer.getCronExpression().equals(cron)
723 && cronTimer.getRemainTimes() == times
724 && cronTimer.getEndTime() == endTime
725 && cronTimer.getMissfirePolicy() == missfirePolicy
726 && cronTimer.getOneByOneKey().equals(oneByOneKey);
727 }
728 }
729 }
730 }
731 }
732 return false;
733 }
734
735 /**
736 * 取消一个具体的Timer实例。

Callers 3

scheduleNamedMethod · 0.95
scheduleOfflineMethod · 0.80
scheduleOfflineMethod · 0.80

Calls 15

getTimersMethod · 0.80
containsKeyMethod · 0.65
getMethod · 0.65
getServerIdMethod · 0.65
getNodeIdMethod · 0.65
equalsMethod · 0.65
getHandleNameMethod · 0.65
getNameMethod · 0.65
getBeanMethod · 0.65
getCronExpressionMethod · 0.65
getRemainTimesMethod · 0.65
getEndTimeMethod · 0.65

Tested by

no test coverage detected