Package org.waveprotocol.wave.model.operation

Examples of org.waveprotocol.wave.model.operation.OperationRuntimeException


          @Override
          public void consume(WaveletOperation operation) {
            try {
              operation.apply(data);
            } catch (OperationException e) {
              throw new OperationRuntimeException("Error applying op", e);
            }
          }
        };
        return new OpBasedWavelet(waveId,
            data,
View Full Code Here


  private IndexedDocument<Node, Element, Text> getDocument() {
    if (substrateDocument == null) {
      try {
        createSubstrateDocument();
      } catch (OperationException e) {
        throw new OperationRuntimeException(
            "Document initialization failed when applying operation: " +
            documentCreationContext.content, e);
      }
    }
    return substrateDocument;
View Full Code Here

        DocOp docOp = sink.consumeAndReturnInvertible(op);
        if (outputSink != null) {
          outputSink.consume(docOp);
        }
      } catch (OperationException e) {
        throw new OperationRuntimeException(
            "DocumentOperationSink constructed by DocumentOperationSinkFactory "
                + "generated an OperationException when attempting to apply " + op, e);
      }
    }
View Full Code Here

  @Override
  public void consumeAsDiff(DocOp op) {
    try {
      differ.consume(op);
    } catch (OperationException e) {
      throw new OperationRuntimeException("error applying diff op", e);
    }
    hasDiffs = true;
  }
View Full Code Here

   * TODO(zdwang): Remove this, it's better to just throw exceptions at the source, the leave the
   * exception policy to the caller.
   */
  void handleException(OperationException e) {
    // TODO(user): implement appropriate policy
    throw new OperationRuntimeException("OpBasedWavelet caught exception: " + e, e);
  }
View Full Code Here

      DocInitialization initialisation = DocOpUtil.asInitialization(bothOps);
      assert DocOpValidator.validate(null, schemaConstraints, initialisation).isValid();

      return initialisation;
    } catch (OperationException e) {
      throw new OperationRuntimeException("Bug either in indexed document or the composer", e);
    }
  }
View Full Code Here

   */
  private static DocInitialization compose(DocInitialization state, DocOp diff) {
    try {
      return diff != null ? Composer.compose(state, diff) : state;
    } catch (OperationException e) {
      throw new OperationRuntimeException("error occurred during diff compaction", e);
    }
  }
View Full Code Here

      public void consume(O operation) {
        try {
          operation.apply(data);
        } catch (OperationException e) {
          // Fail this object permanently
          throw new OperationRuntimeException("Error applying op", e);
        }
      }
    };
    return new LiveTarget<T, O>(data, executor, output);
  }
View Full Code Here

        death = new SchemaViolatingLocalOperationException(oe.getViolations());
      } else {
        death = new BadOpLocalOperationException(oe.getViolations());
      }
    } else {
      death = new OperationRuntimeException("Invalid for current document", oe);
    }

    // If the op failed, the document may be arbitrarily broken state, so there
    // is no reason to believe that a repair will work, let alone execute
    // without throwing its own exceptions. Nevertheless, since we're about to
View Full Code Here

    IndexedDocumentImpl<N, E, T, ?> doc = new IndexedDocumentImpl<N, E, T, Void>(
        substrateProvider.create("doc", Attributes.EMPTY_MAP), annotations, schema);
    try {
      doc.consume(operation);
    } catch (OperationException e) {
      throw new OperationRuntimeException("Invalid initialization", e);
    }
    return doc;
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.operation.OperationRuntimeException

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.