CcBasedWavelet(WaveId waveId, WaveletOperationContext.Factory contextFactory, ParticipationHelper participationHelper, OperationChannel channel, ObservableWaveletData target, CcDocumentFactory<?> docFactory, FailureHandler failureHandler, DuplexOpSinkFactory opTaps) { this.docFactory = docFactory; this.channel = channel; this.failureHandler = failureHandler; Preconditions.checkNotNull(opTaps, "OpTaps cannot be null"); // Sink through which all operations are sent to remote state remote = new ChannelAdapter(channel); // Sink through which all operations are applied to local state applier = new OperationApplier(target, target.getWaveletId()); opTap = opTaps.create(target.getWaveletId(), applier, remote); // Create operation adapter, which translates semantic methods into // operations, applying them to the target as well as sending them down // the operation channel. Local operation failure fails this wavelet // permanently. wavelet = new OpBasedWavelet(waveId, target, contextFactory, participationHelper, opTap.incoming(), opTap.outgoing()); // Create operation sucker, which sucks operations out of the channel and // applies them to the CC target. driver = new OperationSucker(channel, opTap.incoming()); channel.setListener(driver); }