Examples of OpDto


Examples of org.jboss.errai.otec.client.OpDto

  public static void startOTService(final MessageBus messageBus, final OTEngine engine) {
    messageBus.subscribe("ServerOTEngine", new MessageCallback() {

      @Override
      public void callback(final Message message) {
        final OpDto value = message.getValue(OpDto.class);
        final QueueSession queueSession = message.getResource(QueueSession.class, "Session");
        final String session = queueSession.getSessionId();
        final OTPeer peer = engine.getPeerState().getPeer(session);

        if (peer == null) {
          System.out.println("SessionID: " + session);
          System.out.println("No session for: " + message.getParts());
          return;
        }

        if (value == null && message.hasPart("PurgeHint")) {
          final Integer purgeHint = message.get(Integer.class, "PurgeHint");
          final Integer entityId = message.get(Integer.class, "EntityId");

          peer.setLastKnownRemoteSequence(entityId, purgeHint);
        }
        else if (value != null) {
          final OTEntity entity = engine.getEntityStateSpace().getEntity(value.getEntityId());
          if (entity == null) {
            return;
          }
          synchronized (entity) {
            ClientDemuxer demux = LocalContext.get(queueSession).getAttribute(ClientDemuxer.class);
View Full Code Here

Examples of org.jboss.errai.otec.client.OpDto

      if (updated) {
        final List<OpDto> ops = new ArrayList<OpDto>();
        ops.add(dto);

        final Iterator<OpDto> dtosHeld = outOfOrders.iterator();
        OpDto d = dto;
        while (dtosHeld.hasNext()) {
          final OpDto heldDto = dtosHeld.next();
          if (heldDto.getLastRevisionTx() == d.getRevision()) {
            ops.add(heldDto);
            dtosHeld.remove();
            lastSequence.set(heldDto.getRevision());
            d = heldDto;
          }
        }

        return ops;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.