/** * Places a concurrency-control driver and target on top of the new * operation channel. All wavelet model objects are created through this * method. * * @param target target to be controller by operations * @param channel channel for operation communication * @return new wavelet */ CcBasedWavelet create(OperationChannel channel, ObservableWaveletData target) { return new CcBasedWavelet(waveId, contextFactory, participationHelper, channel, target, docFactory, failureHandler, opTaps); } }
@Override public void addParticipant(ParticipantId participant) { checkNotFailed(); wavelet.addParticipant(participant); }
assertEquals(GENERATED_WAVELET_ID, createdWavelet.getId()); assertNotNull(viewListener.addedWavelet); viewListener.reset(); .setWaveletId(GENERATED_WAVELET_ID).addDelta(delta1)); assertEquals(2, createdWavelet.getParticipantIds().size());
@Override public void onOperationChannelCreated(OperationChannel channel, ObservableWaveletData snapshot, Accessibility accessibility) { // New wavelet has come into existence. Build a model on top. CcBasedWavelet wavelet = waveletFactory.create(channel, snapshot); // Keep this wavelet around for future changes. wavelets.put(wavelet.getId(), wavelet); // Mark inaccessible if necessary. if (accessibility == Accessibility.INACCESSIBLE) { terminalWavelets.markTerminal(wavelet); } listener.onWaveletAdded(wavelet); }
assertEquals(GENERATED_WAVELET_ID, createdWavelet.getId()); assertNotNull(viewListener.addedWavelet); viewListener.reset(); .setWaveletId(GENERATED_WAVELET_ID).addDelta(delta1)); assertEquals(2, createdWavelet.getParticipantIds().size());
@Override public void onWaveletAdded(CcBasedWavelet wavelet) { if (view.getWavelet(wavelet.getId()) != null) { logger.error().log( "Ignoring new channel for existing wavelet " + wavelet.getId() + " in wave " + view.getWaveId()); } else { if (holder.isExpecting()) { holder.push(wavelet); } else { view.addWavelet(wavelet); } } }
@Override public void addParticipantIds(Set<ParticipantId> participants) { checkNotFailed(); wavelet.addParticipantIds(participants); }
@Override public void removeParticipant(ParticipantId participant) { checkNotFailed(); wavelet.removeParticipant(participant); }