public void run() { for (int i = 0; i < batches.length; i++) { TXLockBatch batch = (TXLockBatch) batches[i]; // send TXOriginatorDepartureMessage Set participants = batch.getParticipants(); TXOriginatorRecoveryProcessor.sendMessage( participants, owner, batch.getTXLockId(), grantor, dm); } } });
/** * Update the Grantor with a new set of Participants. This method is meant to be used * in a local context (does <b>NOT</b> involve any messaging) */ public static void updateParticipants(DLockService svc, TXLockId txLockId, Set updatedParticipants) { DLockGrantor grantor = null; try { grantor = DLockGrantor.waitForGrantor(svc); if (grantor != null) { try { TXLockBatch txb = (TXLockBatch) grantor.getLockBatch(txLockId); if (txb == null) { // we became grantor after the original grantor left // fixes bug 42656 return; } txb.setParticipants(updatedParticipants); grantor.updateLockBatch(txLockId, txb); } catch (LockGrantorDestroyedException ignoreit) { } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }
this.txLockIdList.add(txLockId); TXLockBatch batch = new TXLockBatch(txLockId, regionLockReqs, participants);