Package org.fudgemsg.mapping

Examples of org.fudgemsg.mapping.FudgeDeserializer.fudgeMsgToObject()


      for (String value : values) {
        decode(msg, key, value);
      }
    }
    FudgeDeserializer deser = new FudgeDeserializer(context);
    return deser.fudgeMsgToObject(type, msg);
  }

  private static void decode(MutableFudgeMsg msg, String key, String value) {
    if (key.contains(".")) {
      String key1 = StringUtils.substringBefore(key, ".");
View Full Code Here


    MutableFudgeMsg inputMsg = serializationContext.objectToFudgeMsg(inDefinition);
    FudgeMsg outputMsg = s_fudgeContext.deserialize(s_fudgeContext.toByteArray(inputMsg)).getMessage();
    assertNotNull(outputMsg);
   
    FudgeDeserializer deserializationContext = new FudgeDeserializer(s_fudgeContext);
    BloombergSecurityTypeDefinition outDefinition = deserializationContext.fudgeMsgToObject(BloombergSecurityTypeDefinition.class, outputMsg);
   
    assertEquals(inDefinition, outDefinition);
  }

  private BloombergSecurityTypeDefinition createDefinition() {
View Full Code Here

    FudgeMsg message = reader.nextMessage();
    if (message == null) {
      return null;
    }
    FudgeDeserializer deser = new FudgeDeserializer(getFudgeContext());
    return deser.fudgeMsgToObject(type, message);
  }

}
View Full Code Here

    FudgeMsg message = reader.nextMessage();
    if (message == null) {
      return null;
    }
    FudgeDeserializer deser = new FudgeDeserializer(getFudgeContext());
    return deser.fudgeMsgToObject(type, message);
  }

}
View Full Code Here

    FudgeMsg message = reader.nextMessage();
    if (message == null) {
      return null;
    }
    FudgeDeserializer deser = new FudgeDeserializer(getFudgeContext());
    return deser.fudgeMsgToObject(type, message);
  }

}
View Full Code Here

    FudgeMsg outputMsg = s_fudgeContext.deserialize(s_fudgeContext.toByteArray(inputMsg)).getMessage();
    assertNotNull(outputMsg);
    assertEquals(3, outputMsg.getNumFields());
   
    FudgeDeserializer deserializationContext = new FudgeDeserializer(s_fudgeContext);
    HistoricalTimeSeriesRating outputConfig = deserializationContext.fudgeMsgToObject(HistoricalTimeSeriesRating.class, outputMsg);
   
    assertEquals(inputConfig, outputConfig);
  }

}
View Full Code Here

    }

    @Override
    public void messageReceived(final FudgeContext fudgeContext, final FudgeMsgEnvelope msgEnvelope) {
      final FudgeDeserializer deserializer = new FudgeDeserializer(fudgeContext);
      final CacheMessage request = deserializer.fudgeMsgToObject(CacheMessage.class, msgEnvelope.getMessage());
      CacheMessage response = request.accept(this);
      if (response == null) {
        if (request.getCorrelationId() != null) {
          response = new CacheMessage();
        }
View Full Code Here

  }

  @Override
  public void messageReceived(final FudgeContext fudgeContext, final FudgeMsgEnvelope msgEnvelope) {
    final FudgeDeserializer deserializer = new FudgeDeserializer(fudgeContext);
    final RemoteCalcNodeMessage message = deserializer.fudgeMsgToObject(RemoteCalcNodeMessage.class, msgEnvelope.getMessage());
    if (message instanceof Invocations) {
      messageReceived(getUnderlying(), (Invocations) message);
    } else {
      throw new UnsupportedOperationException("Unexpected message - " + message);
    }
View Full Code Here

      final long correlationId = getNextCorrelationId();
      request.setCorrelationId(correlationId);
      final FudgeMsg responseMsg = sendRequestAndWaitForResponse(FudgeSerializer.addClassHeader(scontext.objectToFudgeMsg(request), request.getClass(), CacheMessage.class),
          correlationId);
      final FudgeDeserializer dcontext = new FudgeDeserializer(getMessageSender().getFudgeContext());
      final Response response = dcontext.fudgeMsgToObject(responseClass, responseMsg);
      return response;
    }

    private <Message extends CacheMessage> void postMessage(final Message message) {
      final FudgeSerializer scontext = new FudgeSerializer(getMessageSender().getFudgeContext());
View Full Code Here

  public FunctionBlacklistPolicy getPolicy(final UniqueId uniqueId) {
    ArgumentChecker.notNull(uniqueId, "uniqueId");
    try {
      final FudgeDeserializer fdc = new FudgeDeserializer(getFudgeContext());
      final FudgeMsg response = accessRemote(UriBuilder.fromUri(getBaseUri()).path("uid/{uniqueId}").build(uniqueId.toString())).get(FudgeMsg.class);
      return fdc.fudgeMsgToObject(FunctionBlacklistPolicy.class, response);
    } catch (UniformInterfaceException404NotFound e) {
      return null;
    }
  }
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.