Examples of CacheMessage


Examples of com.opengamma.engine.cache.msg.CacheMessage

    }

    @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();
        }
      }
      if (response != null) {
        response.setCorrelationId(request.getCorrelationId());
        final FudgeSerializer sctx = new FudgeSerializer(fudgeContext);
        final MutableFudgeMsg responseMsg = sctx.objectToFudgeMsg(response);
        // We have only one response for each request type, so don't really need the headers
        // FudgeSerializer.addClassHeader(responseMsg, response.getClass(), BinaryDataStoreResponse.class);
        getConnection().getFudgeMessageSender().send(responseMsg);
View Full Code Here

Examples of com.opengamma.engine.cache.msg.CacheMessage

    }

    @Override
    public void messageReceived(final FudgeContext context, final FudgeMsgEnvelope message) {
      final FudgeDeserializer deserializer = new FudgeDeserializer(context);
      final CacheMessage request = deserializer.fudgeMsgToObject(CacheMessage.class, message.getMessage());
      CacheMessage response = request.accept(this);
      if (response == null) {
        if (request.getCorrelationId() != null) {
          response = new CacheMessage();
        }
      }
      if (response != null) {
        response.setCorrelationId(request.getCorrelationId());
        final FudgeSerializer sctx = new FudgeSerializer(context);
        final MutableFudgeMsg responseMsg = sctx.objectToFudgeMsg(response);
        // We have only one response type for each request, so don't really need the headers
        // FudgeSerializer.addClassHeader(responseMsg, response.getClass(), CacheMessage.class);
        getConnection().getFudgeMessageSender().send(responseMsg);
View Full Code Here

Examples of com.opengamma.engine.cache.msg.CacheMessage

  // above

  @Override
  public void messageReceived(final FudgeContext fudgeContext, final FudgeMsgEnvelope msgEnvelope) {
    final FudgeDeserializer deserializer = new FudgeDeserializer(fudgeContext);
    final CacheMessage message = deserializer.fudgeMsgToObject(CacheMessage.class, msgEnvelope.getMessage());
    message.accept(_messageReceiver);
  }
View Full Code Here

Examples of com.opengamma.engine.cache.msg.CacheMessage

    return response;
  }

  @Override
  public FudgeMsg requestReceived(final FudgeDeserializer deserializer, final FudgeMsgEnvelope requestEnvelope) {
    final CacheMessage request = deserializer.fudgeMsgToObject(CacheMessage.class, requestEnvelope.getMessage());
    final FudgeContext fudgeContext = deserializer.getFudgeContext();
    CacheMessage response = request.accept(this);
    if (response == null) {
      response = new CacheMessage();
    }
    response.setCorrelationId(request.getCorrelationId());
    final FudgeSerializer ctx = new FudgeSerializer(fudgeContext);
    final MutableFudgeMsg responseMsg = ctx.objectToFudgeMsg(response);
    // We have only one response for each request type, so don't need the headers
    // FudgeSerializer.addClassHeader(responseMsg, response.getClass(), IdentifierMapResponse.class);
    return responseMsg;
View Full Code Here

Examples of org.atmosphere.cache.CacheMessage

        final Map<String, BroadcastMessage> cache = new HashMap<String, BroadcastMessage>();

        broadcaster.getBroadcasterConfig().setBroadcasterCache(new AbstractBroadcasterCache() {
            @Override
            public CacheMessage addToCache(String id, String uuid, BroadcastMessage e) {
                CacheMessage c = put(e, System.nanoTime(), uuid);
                cache.put(id, e);
                return c;
            }

            @Override
View Full Code Here

Examples of org.atmosphere.cache.CacheMessage

    @Test
    public void testRejectedCache() throws ExecutionException, InterruptedException, ServletException {
        broadcaster.getBroadcasterConfig().setBroadcasterCache(new AbstractBroadcasterCache() {
            @Override
            public CacheMessage addToCache(String id, String uuid, BroadcastMessage e) {
                CacheMessage c = put(e, System.nanoTime(), uuid);
                cachedMessage.set(messages);
                return c;
            }

            @Override
View Full Code Here

Examples of org.atmosphere.cache.CacheMessage

    @Test
    public void testCache() throws ExecutionException, InterruptedException, ServletException {
        broadcaster.getBroadcasterConfig().setBroadcasterCache(new AbstractBroadcasterCache() {
            @Override
            public CacheMessage addToCache(String id, String uuid, BroadcastMessage e) {
                CacheMessage c = put(e, System.nanoTime(), uuid);
                cachedMessage.set(messages);
                return c;
            }

            @Override
View Full Code Here

Examples of org.atmosphere.cache.CacheMessage

    public void testEmptyRejectedCache() throws ExecutionException, InterruptedException, ServletException {
        final CountDownLatch latch = new CountDownLatch(1);
        broadcaster.getBroadcasterConfig().setBroadcasterCache(new AbstractBroadcasterCache() {
            @Override
            public CacheMessage addToCache(String id, String uuid, BroadcastMessage e) {
                CacheMessage c = put(e, System.nanoTime(), uuid);
                cachedMessage.set(messages);
                latch.countDown();
                return c;
            }
View Full Code Here

Examples of org.atmosphere.cache.CacheMessage

    public void testEmptyCache() throws ExecutionException, InterruptedException, ServletException {
        final CountDownLatch latch = new CountDownLatch(1);
        broadcaster.getBroadcasterConfig().setBroadcasterCache(new AbstractBroadcasterCache() {
            @Override
            public CacheMessage addToCache(String id, String uuid, BroadcastMessage e) {
                CacheMessage c = put(e, System.nanoTime(), uuid);
                cachedMessage.set(messages);
                latch.countDown();
                return c;
            }
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.