コード例 #1
0
 private synchronized void generateParams(SchedullerPackage schedullerPackage) {
   schedullerPackage.messageId = generateMessageId();
   schedullerPackage.seqNo = generateSeqNo();
   schedullerPackage.idGenerationTime = getCurrentTime();
   schedullerPackage.relatedMessageIds.add(schedullerPackage.messageId);
   schedullerPackage.generatedMessageIds.add(schedullerPackage.messageId);
 }
コード例 #2
0
 public void resetSession() {
   lastMessageId = 0;
   lastDependId = 0;
   seqNo = 0;
   currentMessageGeneration.clear();
   for (SchedullerPackage schedullerPackage :
       messages.values().toArray(new SchedullerPackage[0])) {
     schedullerPackage.idGenerationTime = 0;
     schedullerPackage.dependMessageId = 0;
     schedullerPackage.messageId = 0;
     schedullerPackage.seqNo = 0;
   }
 }
コード例 #3
0
 public void resendAsNewMessageDelayed(long msgId, int delay) {
   for (SchedullerPackage schedullerPackage :
       messages.values().toArray(new SchedullerPackage[0])) {
     if (schedullerPackage.relatedMessageIds.contains(msgId)) {
       schedullerPackage.idGenerationTime = 0;
       schedullerPackage.dependMessageId = 0;
       schedullerPackage.messageId = 0;
       schedullerPackage.seqNo = 0;
       schedullerPackage.state = STATE_QUEUED;
       schedullerPackage.scheduleTime = getCurrentTime() + delay;
       Logger.d(TAG, "Resending as new #" + schedullerPackage.id);
     }
   }
 }