Package org.waveprotocol.wave.concurrencycontrol.client

Examples of org.waveprotocol.wave.concurrencycontrol.client.ConcurrencyControl$ConnectionListener


   * Connects the channel at the provided version.
   */
  private void connectChannel(long version, byte[] signature) throws ChannelException {
    final HashedVersion signatureInfo = HashedVersion.of(version, signature);
    deltaChannel = new MockWaveletDeltaChannel();
    cc = new ConcurrencyControl(ccLogger, signatureInfo);
    operationChannel = new OperationChannelImpl(opLogger, deltaChannel, cc,
        Accessibility.READ_WRITE);
    operationChannel.setListener(listener);
    operationChannel.onConnection(signatureInfo, signatureInfo);
  }
View Full Code Here


  }

  public void testSendToInaccessibleChanneFails() throws ChannelException {
    final HashedVersion connectSig = HashedVersion.unsigned(0);
    deltaChannel = new MockWaveletDeltaChannel();
    cc = new ConcurrencyControl(ccLogger, connectSig);
    operationChannel = new OperationChannelImpl(opLogger, deltaChannel, cc,
        Accessibility.READ_ONLY);
    operationChannel.setListener(listener);
    operationChannel.onConnection(connectSig, connectSig);
View Full Code Here

      final UnsavedDataListenerFactory unsavedDataListenerFactory, final LoggerContext loggers) {
    return new OperationChannelFactory() {
      @Override
      public InternalOperationChannel create(WaveletDeltaChannel deltaChannel, WaveletId waveletId,
          HashedVersion startVersion, Accessibility accessibility) {
        ConcurrencyControl cc = new ConcurrencyControl(loggers.cc, startVersion);
        if (unsavedDataListenerFactory != null) {
          cc.setUnsavedDataListener(unsavedDataListenerFactory.create(waveletId));
        }
        return new OperationChannelImpl(loggers.ops, deltaChannel, cc, accessibility);
      }
    };
  }
View Full Code Here

      final UnsavedDataListenerFactory unsavedDataListenerFactory, final LoggerContext loggers) {
    return new OperationChannelFactory() {
      @Override
      public InternalOperationChannel create(WaveletDeltaChannel deltaChannel, WaveletId waveletId,
          HashedVersion startVersion, Accessibility accessibility) {
        ConcurrencyControl cc = new ConcurrencyControl(loggers.cc, startVersion);
        if (unsavedDataListenerFactory != null) {
          cc.setUnsavedDataListener(unsavedDataListenerFactory.create(waveletId));
        }
        return new OperationChannelImpl(loggers.ops, deltaChannel, cc, accessibility);
      }
    };
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.concurrencycontrol.client.ConcurrencyControl$ConnectionListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.