Package org.serviceconnector.net.connection

Examples of org.serviceconnector.net.connection.IConnection.send()


      @SuppressWarnings("unchecked")
      ScheduledFuture<TimeoutWrapper> timeout = (ScheduledFuture<TimeoutWrapper>) AppContext.otiScheduler.schedule(
          timeoutWrapper, (long) timeoutMillis, TimeUnit.MILLISECONDS);
      reqCallback.setOperationTimeout(timeout);
      reqCallback.setTimeoutMillis(timeoutMillis);
      connection.send(message, requesterCallback);
    } catch (Exception ex) {
      this.connectionPool.freeConnection(connection);
      throw ex;
    }
  }
View Full Code Here


        // handling msgSequenceNr
        if (SCMPMessageSequenceNr.necessaryToWrite(message.getMessageType())) {
          part.setHeader(SCMPHeaderAttributeKey.MESSAGE_SEQUENCE_NR, msgSequenceNr.getCurrentNr());
        }
        // send
        connection.send(part, requesterCallback);
      } else {
        requesterCallback = new SCRequesterSCMPCallback(message, scmpCallback, connectionContext, msgSequenceNr);
        // setting up operation timeout after successful send
        TimeoutWrapper timeoutWrapper = new TimeoutWrapper((ITimeout) requesterCallback);
        SCRequesterSCMPCallback reqCallback = (SCRequesterSCMPCallback) requesterCallback;
View Full Code Here

        // handling msgSequenceNr
        if (SCMPMessageSequenceNr.necessaryToWrite(message.getMessageType())) {
          message.setHeader(SCMPHeaderAttributeKey.MESSAGE_SEQUENCE_NR, msgSequenceNr.getCurrentNr());
        }
        // process send
        connection.send(message, requesterCallback);
      }
    } catch (Exception ex) {
      this.connectionPool.freeConnection(connection);
      throw ex;
    }
View Full Code Here

    message.setHeader(SCMPHeaderAttributeKey.LOCAL_DATE_TIME, ldt);

    for (int i = 0; i < 10000; i++) {
      IConnection connection = connectionPool.getConnection();
      TestCallback cbk = new TestCallback();
      connection.send(message, cbk);
      cbk.getMessageSync(1000);
      connectionPool.freeConnection(connection);
      if ((i + 1) % 5000 == 0) {
        testLogger.info("connection nr " + (i + 1) + "...");
      }
View Full Code Here

    for (int i = 0; i < 10000; i++) {
      ConnectionPool cp = new ConnectionPool(TestConstants.HOST, this.port, this.connectionType.getValue(),
          this.keepAliveSeconds, this.keepAliveOTIMillis);
      IConnection connection = cp.getConnection();
      TestCallback cbk = new TestCallback();
      connection.send(message, cbk);
      cbk.getMessageSync(1000);
      cp.freeConnection(connection);
      cp.destroy();
      if ((i + 1) % 5000 == 0) {
        testLogger.info("connection nr " + (i + 1) + "...");
View Full Code Here

    message.setHeader(SCMPHeaderAttributeKey.LOCAL_DATE_TIME, ldt);
    connection.connect();

    for (int i = 0; i < 50000; i++) {
      TestCallback cbk = new TestCallback();
      connection.send(message, cbk);
      TestUtil.checkReply(cbk.getMessageSync(3000));
      if ((i + 1) % 10000 == 0) {
        testLogger.info("message nr " + (i + 1) + "...");
      }
    }
View Full Code Here

    message.setHeader(SCMPHeaderAttributeKey.LOCAL_DATE_TIME, ldt);

    for (int i = 0; i < 50000; i++) {
      connection.connect();
      TestCallback cbk = new TestCallback();
      connection.send(message, cbk);
      TestUtil.checkReply(cbk.getMessageSync(3000));
      connection.disconnect();
      if ((i + 1) % 1000 == 0) {
        testLogger.info("connection nr " + (i + 1) + "...");
      }
View Full Code Here

      IIdleConnectionCallback idleCallback = new IdleCallback();
      ConnectionContext connectionContext = new ConnectionContext(connection, idleCallback, 0);
      connection.setContext(connectionContext);
      connection.connect();
      TestCallback cbk = new TestCallback();
      connection.send(message, cbk);
      TestUtil.checkReply(cbk.getMessageSync(3000));
      if ((i + 1) % 100 == 0) {
        testLogger.info("connection nr " + (i + 1) + "...");
      }
    }
View Full Code Here

      IIdleConnectionCallback idleCallback = new IdleCallback();
      ConnectionContext connectionContext = new ConnectionContext(connection, idleCallback, 0);
      connection.setContext(connectionContext);
      connection.connect();
      TestCallback cbk = new TestCallback();
      connection.send(message, cbk);
      TestUtil.checkReply(cbk.getMessageSync(3000));
      if ((i + 1) % 100 == 0) {
        testLogger.info("connection nr " + (i + 1) + "...");
      }
    }
View Full Code Here

    message.setHeader(SCMPHeaderAttributeKey.LOCAL_DATE_TIME, ldt);

    for (int i = 0; i < 10000; i++) {
      IConnection connection = connectionPool.getConnection();
      TestCallback cbk = new TestCallback();
      connection.send(message, cbk);
      cbk.getMessageSync(1000);
      connectionPool.freeConnection(connection);
      if ((i + 1) % 5000 == 0) {
        testLogger.info("connection nr " + (i + 1) + "...");
      }
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.