Package com.opengamma.transport

Examples of com.opengamma.transport.FudgeMessageReceiver


  }

  private String startJms() throws JMSException {
    try {
      _startedSignalLatch = new CountDownLatch(1);
      ByteArrayFudgeMessageReceiver bafmr = new ByteArrayFudgeMessageReceiver(new FudgeMessageReceiver() {
        @SuppressWarnings("unchecked")
        @Override
        public void messageReceived(FudgeContext fudgeContext, FudgeMsgEnvelope msgEnvelope) {
          s_logger.debug("Result listener call received");
          Function<ViewResultListener, ?> listenerCall;
View Full Code Here


    s_logger.info("Sending message to resolve ", spec);
    ResolveRequest resolveRequest = new ResolveRequest(spec);
    FudgeMsg requestMessage = resolveRequest.toFudgeMsg(new FudgeSerializer(_fudgeContext));
    final AtomicBoolean responseReceived = new AtomicBoolean(false);
    final AtomicReference<LiveDataSpecification> resolved = new AtomicReference<LiveDataSpecification>();
    _requestSender.sendRequest(requestMessage, new FudgeMessageReceiver() {
     
      @Override
      public void messageReceived(FudgeContext fudgeContext,
          FudgeMsgEnvelope msgEnvelope) {
       
View Full Code Here

    // Build request message
    LiveDataSubscriptionRequest subReqMessage = new LiveDataSubscriptionRequest(user, type, specs);
    FudgeMsg requestMessage = subReqMessage.toFudgeMsg(new FudgeSerializer(getFudgeContext()));
   
    // Build response receiver
    FudgeMessageReceiver responseReceiver;
    if (type == SubscriptionType.SNAPSHOT) {
      responseReceiver = new SnapshotResponseReceiver(subHandles);
    } else {
      responseReceiver = new TopicBasedSubscriptionResponseReceiver(subHandles);
    }
View Full Code Here

    FudgeMsg requestMessage = composeRequestMessage(user, specifications);
   
    final CountDownLatch latch = new CountDownLatch(1);
   
    _requestSender.sendRequest(requestMessage, new FudgeMessageReceiver() {
     
      @Override
      public void messageReceived(FudgeContext fudgeContext,
          FudgeMsgEnvelope msgEnvelope) {
       
View Full Code Here

    jmsConnectorFactoryBean.setName("StandardJms");
    jmsConnectorFactoryBean.setConnectionFactory(jmsConnectionFactory);
    jmsConnectorFactoryBean.setClientBrokerUri(URI.create(activeMQUrl));
   
    JmsConnector jmsConnector = jmsConnectorFactoryBean.getObjectCreating();
    ByteArrayFudgeMessageReceiver fudgeReceiver = new ByteArrayFudgeMessageReceiver(new FudgeMessageReceiver() {
     
      @Override
      public void messageReceived(FudgeContext fudgeContext, FudgeMsgEnvelope msgEnvelope) {
        FudgeMsg message = msgEnvelope.getMessage();
        s_logger.debug("received {}", message);
View Full Code Here

 
  private int[] parallelSendTest(final ExecutorService executorClient, final ExecutorService executorServer, final AtomicInteger concurrencyMax) throws Exception {
    final FudgeConnectionReceiver serverReceiver = new FudgeConnectionReceiver() {
      @Override
      public void connectionReceived(final FudgeContext fudgeContext, final FudgeMsgEnvelope envelope, final FudgeConnection connection) {
        connection.setFudgeMessageReceiver(new FudgeMessageReceiver() {
          @Override
          public void messageReceived(FudgeContext fudgeContext, FudgeMsgEnvelope msgEnvelope) {
            MutableFudgeMsg message = fudgeContext.newMessage();
            message.add("foo", 1);
            connection.getFudgeMessageSender().send(message);
View Full Code Here

      }
      if (envelope == null) {
        terminateWithError("Nothing available on stream - terminating connection", null);
        return;
      }
      final FudgeMessageReceiver receiver = _receiver;
      if (receiver != null) {
        final ExecutorService executorService = getExecutorService();
        if (executorService != null) {
          executorService.execute(new Runnable() {
            @Override
View Full Code Here

        if (envelope == null) {
          s_logger.info("Nothing available on stream. Terminating connection");
          stop();
          return;
        }
        final FudgeMessageReceiver receiver = _receiver;
        if (receiver != null) {
          if (_executorService != null) {
            _executorService.execute(new Runnable() {
              @Override
              public void run() {
                dispatch(receiver, envelope);
              }
            });
          } else {
            dispatch(receiver, envelope);
          }
        }
      }

      private void dispatch(final FudgeMessageReceiver receiver, final FudgeMsgEnvelope envelope) {
        try {
          receiver.messageReceived(_fudgeContext, envelope);
        } catch (Exception e) {
          s_logger.warn("Unable to dispatch message to receiver", e);
        }
      }
View Full Code Here

    final RemoteNodeJobInvoker jobInvoker = new RemoteNodeJobInvoker(Executors.newCachedThreadPool(), initialMessage, conduit.getEnd1(), new InMemoryIdentifierMap(), new FunctionCosts(),
        new DummyFunctionBlacklistQuery(), new DummyFunctionBlacklistMaintainer());
    jobDispatcher.registerJobInvoker(jobInvoker);
    final TestJobResultReceiver resultReceiver = new TestJobResultReceiver();
    final FudgeConnection remoteNode = conduit.getEnd2();
    remoteNode.setFudgeMessageReceiver(new FudgeMessageReceiver() {
      @Override
      public void messageReceived(FudgeContext fudgeContext, FudgeMsgEnvelope msgEnvelope) {
        final FudgeDeserializer dcontext = new FudgeDeserializer(fudgeContext);
        s_logger.debug("message = {}", msgEnvelope.getMessage());
        final RemoteCalcNodeMessage message = dcontext.fudgeMsgToObject(RemoteCalcNodeMessage.class, msgEnvelope.getMessage());
View Full Code Here

    final RemoteNodeJobInvoker jobInvoker = new RemoteNodeJobInvoker(Executors.newCachedThreadPool(), initialMessage, conduit.getEnd1(), new InMemoryIdentifierMap(), new FunctionCosts(),
        new DummyFunctionBlacklistQuery(), new DummyFunctionBlacklistMaintainer());
    jobDispatcher.registerJobInvoker(jobInvoker);
    final FudgeConnection remoteNode = conduit.getEnd2();
    final Random rnd = new Random();
    remoteNode.setFudgeMessageReceiver(new FudgeMessageReceiver() {
      @Override
      public void messageReceived(FudgeContext fudgeContext, FudgeMsgEnvelope msgEnvelope) {
        final FudgeDeserializer dcontext = new FudgeDeserializer(fudgeContext);
        final RemoteCalcNodeMessage message = dcontext.fudgeMsgToObject(RemoteCalcNodeMessage.class, msgEnvelope.getMessage());
        assertNotNull(message);
View Full Code Here

TOP

Related Classes of com.opengamma.transport.FudgeMessageReceiver

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.