Package org.serviceconnector.net.connection

Examples of org.serviceconnector.net.connection.ConnectionPool


   * @param remoteNodeConfiguration
   *            the remote node configuration
   */
  public Requester(RemoteNodeConfiguration remoteNodeConfiguration) {
    this.remoteNodeConfiguration = remoteNodeConfiguration;
    this.connectionPool = new ConnectionPool(remoteNodeConfiguration.getHost(), remoteNodeConfiguration.getPort(),
        remoteNodeConfiguration.getConnectionType(), remoteNodeConfiguration.getKeepAliveIntervalSeconds(), AppContext
            .getBasicConfiguration().getKeepAliveOTIMillis());
    this.connectionPool.setMaxConnections(remoteNodeConfiguration.getMaxPoolSize());
  }
View Full Code Here


   * @param remoteNodeConfiguration
   *            the remote node configuration
   */
  public SCRequester(RemoteNodeConfiguration remoteNodeConfiguration, int keepAliveTimeoutMillis) {
    this.remoteNodeConfiguration = remoteNodeConfiguration;
    this.connectionPool = new ConnectionPool(remoteNodeConfiguration.getHost(), remoteNodeConfiguration.getPort(),
        remoteNodeConfiguration.getConnectionType(), remoteNodeConfiguration.getKeepAliveIntervalSeconds(),
        keepAliveTimeoutMillis);
    this.connectionPool.setMaxConnections(remoteNodeConfiguration.getMaxPoolSize());
    this.msgSequenceNr = new SCMPMessageSequenceNr();
  }
View Full Code Here

            writer.writeEndElement();
            writer.writeEndElement();
            continue;
          }
          if (value instanceof ConnectionPool) {
            ConnectionPool connectionPool = (ConnectionPool) value;
            writer.writeStartElement("connectionPool");
            this.writeBean(writer, connectionPool);
            writer.writeEndElement();
            continue;
          }
View Full Code Here

  }

  @Before
  public void beforeOneTest() throws Exception {
    super.beforeOneTest();
    connectionPool = new ConnectionPool(TestConstants.HOST, this.port, this.connectionType.getValue(), this.keepAliveSeconds,
        this.keepAliveOTIMillis);
  }
View Full Code Here

    message.setMessageType(SCMPMsgType.ATTACH);
    message.setHeader(SCMPHeaderAttributeKey.SC_VERSION, SCVersion.CURRENT.toString());
    message.setHeader(SCMPHeaderAttributeKey.LOCAL_DATE_TIME, ldt);

    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

            writer.writeEndElement();
            writer.writeEndElement();
            continue;
          }
          if (value instanceof ConnectionPool) {
            ConnectionPool connectionPool = (ConnectionPool) value;
            writer.writeStartElement("connectionPool");
            this.writeBean(writer, connectionPool);
            writer.writeEndElement();
            continue;
          }
View Full Code Here

  }

  @Before
  public void beforeOneTest() throws Exception {
    super.beforeOneTest();
    connectionPool = new ConnectionPool(TestConstants.HOST, this.port, this.connectionType.getValue(), this.keepAliveSeconds,
        this.keepAliveOTIMillis);
  }
View Full Code Here

    message.setMessageType(SCMPMsgType.ATTACH);
    message.setHeader(SCMPHeaderAttributeKey.SC_VERSION, SCVersion.CURRENT.toString());
    message.setHeader(SCMPHeaderAttributeKey.LOCAL_DATE_TIME, ldt);

    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

   * @param remoteNodeConfiguration
   *            the remote node configuration
   */
  public SCRequester(RemoteNodeConfiguration remoteNodeConfiguration, int keepAliveTimeoutMillis) {
    this.remoteNodeConfiguration = remoteNodeConfiguration;
    this.connectionPool = new ConnectionPool(remoteNodeConfiguration.getHost(), remoteNodeConfiguration.getPort(),
        remoteNodeConfiguration.getConnectionType(), remoteNodeConfiguration.getKeepAliveIntervalSeconds(),
        keepAliveTimeoutMillis);
    this.connectionPool.setMaxConnections(remoteNodeConfiguration.getMaxPoolSize());
    this.msgSequenceNr = new SCMPMessageSequenceNr();
  }
View Full Code Here

TOP

Related Classes of org.serviceconnector.net.connection.ConnectionPool

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.