Package com.kurento.kmf.thrift.pool

Examples of com.kurento.kmf.thrift.pool.ThriftClientPoolService


  }

  public JsonRpcClientThrift(String serverAddress, int serverPort,
      String localAddress, int localPort) {

    this(new ThriftClientPoolService(new ThriftInterfaceConfiguration(
        serverAddress, serverPort)),
        new ThriftInterfaceExecutorService(
            new ThriftInterfaceConfiguration(serverAddress,
                serverPort)), new InetSocketAddress(
            localAddress, localPort));
View Full Code Here


    // Only wait if KMS uses Thrift
    if (thriftAddress != null) {

      long startWaiting = System.currentTimeMillis();

      ThriftClientPoolService clientPool = new ThriftClientPoolService(
          new ThriftInterfaceConfiguration(thriftAddress.getHost(),
              thriftAddress.getPort()));

      // Wait for a max of 20 seconds
      long timeout = System.currentTimeMillis() + 20000;
      while (true) {
        try {
          clientPool.acquireSync();
          break;
        } catch (ClientPoolException e) {
          try {
            Thread.sleep(100);
            if (System.currentTimeMillis() > timeout) {
View Full Code Here

    if (bean != null) {
      return bean;

    } else {

      ThriftClientPoolService clientPool = new ThriftClientPoolService(
          thriftInterfaceConfiguration());

      ThriftInterfaceExecutorService executorService = new ThriftInterfaceExecutorService(
          thriftInterfaceConfiguration());
View Full Code Here

    ThriftInterfaceConfiguration cfg = new ThriftInterfaceConfiguration();
    cfg.setServerAddress("127.0.0.1");
    cfg.setServerPort(19191);

    ThriftClientPoolService clientPool = new ThriftClientPoolService(
        cfg);

    ThriftInterfaceExecutorService executorService = new ThriftInterfaceExecutorService(
        cfg);

    ThriftServer clientServer = new ThriftServer(clientProcessor,
        executorService, new InetSocketAddress("127.0.0.1", 7979));
    clientServer.start();

    ThriftServer server = new ThriftServer(serverProcessor,
        executorService, new InetSocketAddress("127.0.0.1", 19191));
    server.start();

    Client client = clientPool.acquireSync();

    String message = "Test echo message";

    String result = client.invokeJsonRpc(message);
View Full Code Here

TOP

Related Classes of com.kurento.kmf.thrift.pool.ThriftClientPoolService

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.