Package com.opengamma.transport

Examples of com.opengamma.transport.FudgeConnectionReceiver


  public void simpleTest() throws Exception {
    final FudgeMsg testMessage1 = createMessage();
    final FudgeMsg testMessage2 = createMessage();
    // receiver will respond to testMessage1 with testMessage2
    final FudgeConnectionReceiver serverReceiver = new FudgeConnectionReceiver() {
      @Override
      public void connectionReceived(FudgeContext fudgeContext, FudgeMsgEnvelope message, FudgeConnection connection) {
        assertNotNull(fudgeContext);
        assertNotNull(message);
        assertNotNull(connection);
View Full Code Here


    final FudgeMsg testMessage3 = createMessage();
    final CollectingFudgeMessageReceiver message3Receiver = new CollectingFudgeMessageReceiver();
    // receiver will ignore testMessage1
    // after receiving testMessage2, will set the message receiver on the connection
    // it shouldn't be called again - messages should be dispatched to the connection's receiver
    final FudgeConnectionReceiver serverReceiver = new FudgeConnectionReceiver() {
      private int _count;
      @Override
      public void connectionReceived(final FudgeContext fudgeContext, final FudgeMsgEnvelope message, final FudgeConnection connection) {
        assertNotNull(fudgeContext);
        assertNotNull(message);
View Full Code Here

  @Test(invocationCount = 5, successPercentage = 19)
  public void parallelIOTest() throws Exception {
    final MessageReadWrite serverThread = new MessageReadWrite();
    // receiver will attach the serverThread to the connection and start the thread
    final FudgeConnectionReceiver serverReceiver = new FudgeConnectionReceiver() {
      @Override
      public void connectionReceived(final FudgeContext fudgeContext, final FudgeMsgEnvelope envelope, final FudgeConnection connection) {
        // pass on the first message
        serverThread.messageReceived(fudgeContext, envelope);
        // and let it receive all others as they arrive
View Full Code Here

    server.stop();
    client.stop();
  }
 
  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) {
View Full Code Here

TOP

Related Classes of com.opengamma.transport.FudgeConnectionReceiver

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.