Examples of RemoteHost


Examples of com.kurento.kmf.test.services.RemoteHost

    do {
      nodeCandidate = nodeList.get(Randomizer.getInt(0, nodeList.size()));
      log.debug("Node candidate {}", nodeCandidate);

      if (RemoteHost.ping(nodeCandidate)) {
        RemoteHost remoteHost = new RemoteHost(nodeCandidate,
            getProperty("test.node.login"),
            getProperty("test.node.passwd"));
        try {
          remoteHost.start();
          int xvfb = remoteHost.runAndWaitCommand("xvfb-run");
          if (xvfb != 2) {
            log.debug("Node {} has no Xvfb", nodeCandidate);
          } else {
            nodes.add(new Node(nodeCandidate, browser, video, audio));
          }
        } catch (Exception e) {
          log.debug("Invalid credentials to access node {} ",
              nodeCandidate);
        } finally {
          remoteHost.stop();
        }

      } else {
        log.debug("Node {} seems to be down", nodeCandidate);
      }
View Full Code Here

Examples of com.kurento.kmf.test.services.RemoteHost

    List<String> nodesOk = new ArrayList<String>();

    for (String node : nodeList) {
      if (RemoteHost.ping(node)) {

        RemoteHost remoteHost = new RemoteHost(node,
            getProperty("test.node.login"),
            getProperty("test.node.passwd"));
        try {
          remoteHost.start();
          int xvfb = remoteHost.runAndWaitCommand("xvfb-run");
          if (xvfb != 2) {
            nodesWithoutXvfb.add(node);
          } else {
            nodesOk.add(node);
          }
          log.info("{} {}", node, xvfb);
        } catch (Exception e) {
          log.error("Exception in node {} : {}", node, e.getClass());
          nodesWithException.add(node);
        } finally {
          remoteHost.stop();
        }
      } else {
        log.error("Node down {}", node);
        nodesDown.add(node);
      }
View Full Code Here

Examples of groovyx.gpars.remote.RemoteHost

        this.connection = connection;
    }

    @Override
    protected void encode(ChannelHandlerContext ctx, Serializable msg, ByteBuf out) throws Exception {
        final RemoteHost remoteHost = connection.getHost();

        if (remoteHost != null) {
            remoteHost.enter();
        }
        try {
            super.encode(ctx, msg, out);
        }
        catch (Exception e) {
            e.printStackTrace();
            throw e;
        }
        finally {
            if (remoteHost != null) {
                remoteHost.leave();
            }
        }
    }
View Full Code Here

Examples of groovyx.gpars.remote.RemoteHost

        this.connection = connection;
    }

    @Override
    protected Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
        final RemoteHost remoteHost = connection.getHost();

        if (remoteHost != null) {
            remoteHost.enter();
        }
        try {
            return super.decode(ctx, in);
        }
        finally {
            if (remoteHost != null) {
                remoteHost.leave();
            }
        }
    }
View Full Code Here

Examples of groovyx.gpars.remote.RemoteHost

                this.serialId = serialId;
            }

            @Override
            public void execute(final RemoteConnection conn) {
                final RemoteHost remoteHost = conn.getHost();
                final SerialHandle handle = remoteHost.get(serialId);
                if (handle instanceof LocalSerialHandle) {
                    handle.unsubscribe(remoteHost);
                }
            }
View Full Code Here

Examples of groovyx.gpars.remote.RemoteHost

                @Override
                @SuppressWarnings("unchecked")
                public void run() {
                    final Object sub = serialHandle.getSubscribers();
                    if (sub instanceof RemoteHost) {
                        final RemoteHost host = (RemoteHost) sub;
                        if (hostId == null || !host.getHostId().equals(hostId)) {
                            host.write(new BindDataflow(DataflowExpression.this, value, host.getLocalHost().getId()));
                        }
                    }
                    if (sub instanceof List) {
                        //noinspection SynchronizeOnNonFinalField
                        synchronized (serialHandle) {
                            for (final SerialContext host : (List<SerialContext>) sub) {
                                if (hostId == null || !host.getHostId().equals(hostId)) {
                                    host.write(new BindDataflow(DataflowExpression.this, value, host.getLocalHostId()));
                                }
                            }
                        }
                    }
                }
View Full Code Here

Examples of groovyx.gpars.remote.RemoteHost

    private void notifyRemote(T value) {
        if (serialHandle != null) {
            // TODO schedule this job?
            final Object sub = serialHandle.getSubscribers();
            if (sub instanceof RemoteHost) {
                RemoteHost remoteHost = (RemoteHost)sub;
                remoteHost.write(new BindDataflowStream(this, value));
            }
            if (sub instanceof List) {
                List<RemoteHost> subs = (List<RemoteHost>) sub;
                for (RemoteHost subscriber : subs) {
                    subscriber.write(new BindDataflowStream<T>(this, value));
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.