• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java OperationRuntimeException类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中org.waveprotocol.wave.model.operation.OperationRuntimeException的典型用法代码示例。如果您正苦于以下问题:Java OperationRuntimeException类的具体用法?Java OperationRuntimeException怎么用?Java OperationRuntimeException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

OperationRuntimeException类属于org.waveprotocol.wave.model.operation包,在下文中一共展示了OperationRuntimeException类的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: processDiffsOnBlip

点赞 3

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
private void processDiffsOnBlip(String blipId) {
  Iterator<? extends OpBasedWavelet> it = getWaveView().getWavelets().iterator();
  while (it.hasNext()) {
    WaveletFragmentDataImpl wavelet = (WaveletFragmentDataImpl)it.next().getWaveletData();
    if (IdUtil.isConversationalId(wavelet.getWaveletId())) {
      try {
        LazyContentBlipDataImpl blip = wavelet.getBlip(blipId);
        if (blip != null && blip.hasContent()) {
          blip.processDiffs();
        }
      } catch (OperationException ex) {
        throw new OperationRuntimeException("Blip operation applying error on " + blipId + ", wavelet "
          + wavelet.getWaveletId(), ex);
      }
    }
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:18,
代码来源:StageOneProvider.java

示例2: createTrivialSequencer

点赞 3

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
/**
 * A simple sequencer
 * @param doc the document to apply non-invertible ops to, and get the invertible ones from
 * @param outputSink optional, may be null.
 */
public static <N, E extends N> OperationSequencer<Nindo> createTrivialSequencer(
    final IndexedDocument<N, E, ? extends N> doc, final OperationSink<DocOp> outputSink) {
  return new OperationSequencer<Nindo>() {

    @Override
    public void begin() {
    }

    @Override
    public void end() {
    }

    @Override
    public void consume(Nindo op) {
      try {
        DocOp docOp = doc.consumeAndReturnInvertible(op);
        if (outputSink != null) {
          outputSink.consume(docOp);
        }
      } catch (OperationException oe) {
        throw new OperationRuntimeException("DocProviders trivial sequencer consume failed.", oe);
      }
    }
  };
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:31,
代码来源:DocProviders.java

示例3: create

点赞 3

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
/**
 * Creates a live-target.
 */
public static <T, O extends Operation<? super T>> LiveTarget<T, O> create(final T data) {
  ProxyOperationSink<O> output = ProxyOperationSink.create();
  SilentOperationSink<O> executor = new SilentOperationSink<O>() {
    @Override
    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);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:19,
代码来源:LiveTarget.java

示例4: createSequencer

点赞 3

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
/**
 * Creates and returns a sequencer which applies incoming ops to the given document
 */
OperationSequencer<Nindo> createSequencer(
    final IndexedDocument<Node, Element, Text> document) {
  return new OperationSequencer<Nindo>() {

    @Override
    public void begin() {
    }

    @Override
    public void end() {
    }

    @Override
    public void consume(Nindo op) {
      try {
        latestOp = document.consumeAndReturnInvertible(op);
      } catch (OperationException oe) {
        throw new OperationRuntimeException("sequencer consume failed.", oe);
      }
    }
  };
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:26,
代码来源:MutableDocumentImplTest.java

示例5: createSequencer

点赞 3

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
/**
 * Creates and returns a sequencer which applies incoming ops to the given
 * document
 */
private static OperationSequencer<Nindo> createSequencer(
    final IndexedDocument<Node, Element, Text> document) {
  return new OperationSequencer<Nindo>() {

    @Override
    public void begin() {
    }

    @Override
    public void end() {
    }

    @Override
    public void consume(Nindo op) {
      try {
        document.consumeAndReturnInvertible(op);
      } catch (OperationException oe) {
        throw new OperationRuntimeException("sequencer consume failed.", oe);
      }
    }
  };
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:27,
代码来源:DocumentHitIteratorTest.java

示例6: createTrivialSequencer

点赞 3

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
/**
 * A simple sequencer
 * @param doc the document to apply non-invertible ops to, and get the invertible ones from
 * @param outputSink optional, may be null.
 */
public final static <N, E extends N> OperationSequencer<Nindo> createTrivialSequencer(
    final IndexedDocument<N, E, ? extends N> doc, final OperationSink<DocOp> outputSink) {
  return new OperationSequencer<Nindo>() {
    @Override
    public void begin() {
    }

    @Override
    public void end() {
    }

    @Override
    public void consume(Nindo op) {
      try {
        DocOp docOp = doc.consumeAndReturnInvertible(op);
        if (outputSink != null) {
          outputSink.consume(docOp);
        }
      } catch (OperationException oe) {
        throw new OperationRuntimeException("DocProviders trivial sequencer consume failed.", oe);
      }
    }
  };
}
 

开发者ID:apache,
项目名称:incubator-wave,
代码行数:30,
代码来源:DocProviders.java

示例7: createSequencer

点赞 3

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
/**
 * Creates and returns a sequencer which applies incoming ops to the given document
 */
OperationSequencer<Nindo> createSequencer(
    final IndexedDocument<Node, Element, Text> document) {
  return new OperationSequencer<Nindo>() {
    @Override
    public void begin() {
    }

    @Override
    public void end() {
    }

    @Override
    public void consume(Nindo op) {
      try {
        latestOp = document.consumeAndReturnInvertible(op);
      } catch (OperationException oe) {
        throw new OperationRuntimeException("sequencer consume failed.", oe);
      }
    }
  };
}
 

开发者ID:apache,
项目名称:incubator-wave,
代码行数:25,
代码来源:MutableDocumentImplTest.java

示例8: createSequencer

点赞 3

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
/**
 * Creates and returns a sequencer which applies incoming ops to the given
 * document
 */
private static OperationSequencer<Nindo> createSequencer(
    final IndexedDocument<Node, Element, Text> document) {
  return new OperationSequencer<Nindo>() {
    @Override
    public void begin() {
    }

    @Override
    public void end() {
    }

    @Override
    public void consume(Nindo op) {
      try {
        document.consumeAndReturnInvertible(op);
      } catch (OperationException oe) {
        throw new OperationRuntimeException("sequencer consume failed.", oe);
      }
    }
  };
}
 

开发者ID:apache,
项目名称:incubator-wave,
代码行数:26,
代码来源:DocumentHitIteratorTest.java

示例9: deserialize

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
private WaveletFragmentDataImpl deserialize(WaveletFragment waveletFragment) {
  WaveletId id = deserializeWaveletId(waveletFragment.getWaveletId());
  ParticipantId creator = null;
  long creationTime = 0;
  Map<SegmentId, RawFragment> fragments = new HashMap();
  for (SegmentFragment rawFragment : waveletFragment.getFragment()) {
    RawFragment fragment = deserialize(rawFragment);
    SegmentId segmentId = SegmentId.of(rawFragment.getSegmentId());
    if (segmentId.isIndex()) {
      creationTime = fragment.getIndexSnapshot().getCreationTime();
    } else if (segmentId.isParticipants()) {
      creator = fragment.getParticipantsSnapshot().getCreator();
    }
    fragments.put(segmentId, fragment);
  }
  HashedVersion lastModifiedVersion = deserialize(waveletFragment.getLastModifiedVersion());
  long lastModifiedTime = waveletFragment.getLastModifiedTime();

  WaveletFragmentDataImpl waveletData =
      new WaveletFragmentDataImpl(id, creator, creationTime,
          lastModifiedVersion, lastModifiedTime, waveId, docFactory);
  try {
    for (Map.Entry<SegmentId, RawFragment> entry : fragments.entrySet()) {
      waveletData.applyRawFragment(entry.getKey(), entry.getValue());
    }
  } catch (OperationException ex) {
    throw new OperationRuntimeException("Fragment applying error", ex);
  }
  return waveletData;
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:31,
代码来源:RemoteWaveViewService.java

示例10: processDiffsOnParticipants

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
private void processDiffsOnParticipants() {
  Iterator<? extends OpBasedWavelet> it = getWaveView().getWavelets().iterator();
  while (it.hasNext()) {
    WaveletFragmentDataImpl wavelet = (WaveletFragmentDataImpl)it.next().getWaveletData();
    if (IdUtil.isConversationalId(wavelet.getWaveletId())) {
      try {
        wavelet.processParticipantsDiffs();
      } catch (OperationException ex) {
        throw new OperationRuntimeException("Participant operation applying error, wavelet "
          + wavelet.getWaveletId(), ex);
      }
    }
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:15,
代码来源:StageOneProvider.java

示例11: registerFragment

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
@Timed
Fragment registerFragment(Block block, SegmentId segmentId) {
  block.getReadLock().lock();
  try {
    Fragment fragment = block.getFragment(segmentId);
    Segment segment = segmentCache.getOrCreateSegment(waveletName, segmentId, blockState);
    segment.registryFragment(fragment);
    return fragment;
  } catch (OperationException ex) {
    throw new OperationRuntimeException("Fragment registry exception", ex);
  } finally {
    block.getReadLock().unlock();
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:15,
代码来源:SegmentWaveletStateImpl.java

示例12: getSnapshot

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
@Override
public ReadableSegmentSnapshot getSnapshot(long version) {
  Timer timer = Timing.start("FragmentImpl.getSnapshot");
  try {
    SegmentSnapshot snapshot;
    VersionNode nearestNode = getNearestNode(version);
    ReadableSegmentSnapshot nearestNodeSnapshot = nearestNode.getSegmentSnapshot();
    if (nearestNodeSnapshot != null) {
      if (nearestNode.getVersion() == version) {
        return nearestNodeSnapshot;
      }
      snapshot = nearestNodeSnapshot.duplicate();
    } else {
      Preconditions.checkArgument(nearestNode.getVersion() == 0, "Nearest node has not snapshot and is not first");
      snapshot = SegmentSnapshotImpl.createSnapshot(segmentId);
    }
    if (nearestNode.getVersion() != version) {
      List<SegmentOperation> operations = HistoryNavigator.getFragmentHistory(nearestNode, version);
      try {
        for (SegmentOperation operation : operations) {
          for (WaveletOperation op : operation.getOperations()) {
            snapshot.applyAndReturnReverse(op);
          }
        }
      } catch (OperationException ex) {
        throw new OperationRuntimeException("Making snapshot", ex);
      }
    }
    return snapshot;
  } finally {
    Timing.stop(timer);
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:34,
代码来源:FragmentImpl.java

示例13: build

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
@Override
public IndexedDocument<N, E, T> build(DocInitialization operation, DocumentSchema schema) {
  AnnotationTree<Object> annotations =
    new AnnotationTree<Object>(ONE_OBJECT, ANOTHER_OBJECT, null);
  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;
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:14,
代码来源:IndexedDocProvider.java

示例14: BootstrapDocument

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
/** Copy constructor */
public BootstrapDocument(BootstrapDocument other) {
  this(other.schemaConstraints);
  try {
    consume(other.asOperation());
  } catch (OperationException e) {
    throw new OperationRuntimeException("Invalid other document", e);
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:10,
代码来源:BootstrapDocument.java

示例15: consume

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
/**
 * Applies the operation to this document, and then sends it to the output
 * sink.
 *
 * @param op mutation to apply
 */
@Override
public void consume(Nindo op) {
  try {
    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);
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:20,
代码来源:PluggableMutableDocument.java

示例16: getDocument

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
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;
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:13,
代码来源:PluggableMutableDocument.java

示例17: init

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
private void init() {
  initalizeSnapshot();
  try {
    processDiffs();
  } catch (OperationException ex) {
    throw new OperationRuntimeException("Operation applying error", ex);
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:9,
代码来源:LazyContentBlipDataImpl.java

示例18: consume

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
@Override
public void consume(DocOp op) throws OperationException {
  try {
    ContentDocument.this.consume(op, false, true);
  } catch (OperationRuntimeException e) {
    throw e.get();
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:9,
代码来源:ContentDocument.java

示例19: create

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
private void create(String xml) {

    DomDocumentImpl raw = DocProviders.ROJO.parse("<d>" + xml + "</d>");
    DomDocumentImpl raw2 = DocProviders.ROJO.parse("<d>" + xml + "</d>");

    indexed = new ObservableIndexedDocument<Node, Element, Text, Void>(handler, raw, null,
        DocumentSchema.NO_SCHEMA_CONSTRAINTS);
    indexedCopy = new ObservableIndexedDocument<Node, Element, Text, Void>(
        handler2, raw2, null, DocumentSchema.NO_SCHEMA_CONSTRAINTS);

    doc = new MutableDocumentImpl<Node, Element, Text>(
        new OperationSequencer<Nindo>() {

      @Override
      public void begin() {
      }

      @Override
      public void consume(Nindo op) {
        try {
          consumeNindo(op);
        } catch (OperationException e) {
          throw new OperationRuntimeException("Bug!", e);
        }
      }

      @Override
      public void end() {
      }
    }, testNindoConsume ? indexed : indexedCopy);

    root = doc.getDocumentElement();
  }
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:34,
代码来源:ObservableIndexedDocumentTest.java

示例20: doCopyDocument

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
private static IndexedDocumentImpl<Node, Element, Text, ?> doCopyDocument(
    IndexedDocumentImpl<Node, Element, Text, ?> other) {
  IndexedDocumentImpl<Node, Element, Text, ?> doc =
    new IndexedDocumentImpl<Node, Element, Text, Void>(
        DomDocumentImpl.PROVIDER.create("doc", Attributes.EMPTY_MAP), null,
        DocumentSchema.NO_SCHEMA_CONSTRAINTS);
  try {
    doc.consume(other.asOperation());
  } catch (OperationException e) {
    throw new OperationRuntimeException("Copy should not fail", e);
  }
  return doc;
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:14,
代码来源:IndexedDocumentImplTest.java

示例21: consume

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
@Override
public void consume(WaveletOperation op) {
  // Update local version, simulating server response.
  try {
    op.createVersionUpdateOp(data.getVersion()+1, HashedVersion.unsigned(data.getVersion()+1)).apply(data);
  } catch (OperationException e) {
    throw new OperationRuntimeException("test sink verison update failed", e);
  }

  // Pass to output sink.
  output.consume(op);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:13,
代码来源:OpBasedWaveletFactory.java

示例22: getDocOpFromNindo

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
private DocOp getDocOpFromNindo(Nindo nindo) {
  try {
    return DocProviders.POJO.build(editor.getDocumentInitialization(),
        DocumentSchema.NO_SCHEMA_CONSTRAINTS).consumeAndReturnInvertible(nindo);
  } catch (OperationException e) {
    throw new OperationRuntimeException("initialization failed", e);
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:9,
代码来源:OperationGwtTest.java

示例23: create

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
public static <T, O extends Operation<? super T>> LiveTarget<T, O> create(final T data) {
    ProxyOperationSink<O> output = ProxyOperationSink.create();
    SilentOperationSink<O> executor = new SilentOperationSink<O>() {
        @Override
        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);
}
 

开发者ID:apache,
项目名称:incubator-wave-android,
代码行数:16,
代码来源:LiveTarget.java

示例24: consumeAsDiff

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
@Override
public void consumeAsDiff(DocOp op) {
  try {
    differ.consume(op);
  } catch (OperationException e) {
    throw new OperationRuntimeException("error applying diff op", e);
  }
  hasDiffs = true;
}
 

开发者ID:apache,
项目名称:incubator-wave,
代码行数:10,
代码来源:DiffContentDocument.java

示例25: compose

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
/**
 * @return this state into a single operation.
 */
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);
  }
}
 

开发者ID:apache,
项目名称:incubator-wave,
代码行数:11,
代码来源:SimpleDiffDoc.java

示例26: create

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
private void create(String xml) {

    RawDocumentImpl raw = DocProviders.ROJO.parse("<d>" + xml + "</d>");
    RawDocumentImpl raw2 = DocProviders.ROJO.parse("<d>" + xml + "</d>");

    indexed = new ObservableIndexedDocument<Node, Element, Text, Void>(handler, raw, null,
        DocumentSchema.NO_SCHEMA_CONSTRAINTS);
    indexedCopy = new ObservableIndexedDocument<Node, Element, Text, Void>(
        handler2, raw2, null, DocumentSchema.NO_SCHEMA_CONSTRAINTS);

    doc = new MutableDocumentImpl<Node, Element, Text>(
        new OperationSequencer<Nindo>() {
          @Override
          public void begin() {
          }

          @Override
          public void consume(Nindo op) {
            try {
              consumeNindo(op);
            } catch (OperationException e) {
              throw new OperationRuntimeException("Bug!", e);
            }
          }

          @Override
          public void end() {
          }
        }, testNindoConsume ? indexed : indexedCopy);

    root = doc.getDocumentElement();
  }
 

开发者ID:apache,
项目名称:incubator-wave,
代码行数:33,
代码来源:ObservableIndexedDocumentTest.java

示例27: doCopyDocument

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
private static IndexedDocumentImpl<Node, Element, Text, ?> doCopyDocument(
    IndexedDocumentImpl<Node, Element, Text, ?> other) {
  IndexedDocumentImpl<Node, Element, Text, ?> doc =
    new IndexedDocumentImpl<Node, Element, Text, Void>(
        RawDocumentImpl.PROVIDER.create("doc", Attributes.EMPTY_MAP), null,
        DocumentSchema.NO_SCHEMA_CONSTRAINTS);
  try {
    doc.consume(other.asOperation());
  } catch (OperationException e) {
    throw new OperationRuntimeException("Copy should not fail", e);
  }
  return doc;
}
 

开发者ID:apache,
项目名称:incubator-wave,
代码行数:14,
代码来源:IndexedDocumentImplTest.java

示例28: consume

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
@Override
public void consume(WaveletOperation op) {
  // Update local version, simulating server response.
  try {
    op.createVersionUpdateOp(1, null).apply(data);
  } catch (OperationException e) {
    throw new OperationRuntimeException("test sink verison update failed", e);
  }

  // Pass to output sink.
  output.consume(op);
}
 

开发者ID:apache,
项目名称:incubator-wave,
代码行数:13,
代码来源:OpBasedWaveletFactory.java

示例29: renderDocument

点赞 2

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
@Override
public void renderDocument(ConversationBlip blip) {
  Timer timer = Timing.start("BlipDocumentRendererImpl.renderDocument");
  try {
    BlipViewImpl<BlipViewDomImpl> blipUi =
        (BlipViewImpl<BlipViewDomImpl>) modelAsViewProvider.getBlipView(blip);
    if (blipUi != null) {
      BlipMetaDomImpl metaDom = ((BlipMetaViewImpl<BlipMetaDomImpl>) blipUi.getMeta()).getIntrinsic();
      
      // Very first thing that must be done is to extract and save the DOM of
      // inline threads, since content-document rendering will blast them away.
      saveInlineReplies(metaDom);

      // Clear content before rendering, so that doodad events caused by rendering
      // apply on a fresh state.
      metaDom.clearContent();

      // Initialize document.
      blip.initializeSnapshot();
      
      ContentDocument doc = ((DiffContentDocument)blip.getContent()).getDocument();
      Registries registries = documentRegistries.get(blip);
      doc.setRegistries(registries);
      
      // Apply diff-operations.
      try {
        blip.processDiffs();
      } catch (OperationException ex) {
        throw new OperationRuntimeException("Operation applying exception", ex);
      }

      doc.setInteractive(logicalPanel);        
      
      // ContentDocument annotations aren't rendered synchronously, so we have to flush them,
      // rather than reveal half-rendered content at the end of the event cycle.
      AnnotationPainter.flush(doc.getContext());

      metaDom.setContent(doc.getFullContentView().getDocumentElement().getImplNodelet());
    }
  } finally {
    Timing.stop(timer);
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:44,
代码来源:BlipDocumentRendererImpl.java

示例30: handleException

点赞 1

import org.waveprotocol.wave.model.operation.OperationRuntimeException; //导入依赖的package包/类
/**
 * Handles an exception that occured from the local application of an operation produced by this
 * adapter.
 *
 * 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);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:12,
代码来源:OpBasedWavelet.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)