Examples of callAsync()


Examples of hudson.remoting.Channel.callAsync()

            for (ProcessArgument arg : options.getSeleniumArguments()) {
                arguments.addAll(arg.toArgumentsList());
            }

            // listener.getLogger().println("Starting the selenium process");
            jvm.callAsync(new RemoteControlLauncher(nodeName, (String[]) ArrayUtils.addAll(defaultArgs, arguments.toArray(new String[0]))));
            status.setStatus(SeleniumConstants.STARTED);
            status.setRunning(true);
        } catch (Exception t) {
            status.setRunning(false);
            status.setStatus(SeleniumConstants.ERROR);
View Full Code Here

Examples of hudson.remoting.Channel.callAsync()

                    if (lastPing!=null && now-lastPing > TIMEOUT) {
                        LOGGER.info("Repeated ping attempts failed on "+c.getName()+". Disconnecting");
                        c.disconnect(OfflineCause.create(Messages._ConnectionActivityMonitor_OfflineCause()));
                    } else {
                        // send a ping. if we receive a reply, it will be reflected in the next getLastHeard() call.
                        channel.callAsync(PING_COMMAND);
                        if (lastPing==null)
                            channel.setProperty(ConnectionActivityMonitor.class,now);
                    }
                } else {
                    // we are receiving data nicely
View Full Code Here

Examples of hudson.remoting.Channel.callAsync()

                    if (lastPing!=null && now-lastPing > TIMEOUT) {
                        LOGGER.info("Repeated ping attempts failed on "+c.getName()+". Disconnecting");
                        c.disconnect(OfflineCause.create(Messages._ConnectionActivityMonitor_OfflineCause()));
                    } else {
                        // send a ping. if we receive a reply, it will be reflected in the next getLastHeard() call.
                        channel.callAsync(PING_COMMAND);
                        if (lastPing==null)
                            channel.setProperty(ConnectionActivityMonitor.class,now);
                    }
                } else {
                    // we are receiving data nicely
View Full Code Here

Examples of hudson.remoting.VirtualChannel.callAsync()

        VirtualChannel ch = createSlaveChannel();

        // keep the pipe fairly busy
        final Pipe p = Pipe.createRemoteToLocal();
        for (int i=0; i<10; i++)
            ch.callAsync(new ChannelFiller(p.getOut()));
        new Thread() {
            @Override
            public void run() {
                try {
                    IOUtils.drain(p.getIn());
View Full Code Here

Examples of hudson.remoting.VirtualChannel.callAsync()

            TaskListener listener = hudsonLauncher.getListener();
            RemoteCall remoteCall = new RemoteCall(
                    Arrays.asList(cmd), env, in, out, null,
                    remotePath,
                    listener);
            Future future = channel.callAsync(remoteCall);
            currentProcess = new RemoteProc(future);

        } catch(IOException e) {
            //try to close all the pipes before throwing an exception
            closeBuffers();
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService.callAsync()

    }
  }

  public void testAsyncCall() {
    IRemoteService restClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registration.getReference());
    IFuture future = restClientService.callAsync(RestCallFactory.createRestCall(IUserTimeline.class.getName() + ".getUserStatuses"));
    try {
      Object response = future.get();
      assertTrue(response instanceof IUserStatus[]);
    } catch (OperationCanceledException e) {
      fail(e.getMessage());
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService.callAsync()

    }
  }

  public void testAsyncCallWithListener() throws Exception {
    IRemoteService restClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registration.getReference());
    restClientService.callAsync(RestCallFactory.createRestCall(IUserTimeline.class.getName() + ".getUserStatuses"), new IRemoteCallListener() {
      public void handleEvent(IRemoteCallEvent event) {
        if (event instanceof IRemoteCallCompleteEvent) {
          IRemoteCallCompleteEvent cce = (IRemoteCallCompleteEvent) event;
          Object response = cce.getResponse();
          assertTrue(response instanceof IUserStatus[]);
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService.callAsync()

  public void testSimpleClientAndServerWithCallAsync() throws Exception {

    IRemoteService remoteService = client.getRemoteService();
    assertNotNull(remoteService);
    // Use callSync
    remoteService.callAsync(getRemoteConcatCall(TEST_STRING_2, TEST_STRING_1));
   
    Thread.sleep(1000);
   
  }
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService.callAsync()

  public void testSimpleClientAndServerWithCallAsyncListener() throws Exception {

    IRemoteService remoteService = client.getRemoteService();
    assertNotNull(remoteService);
    // Use callSync
    remoteService.callAsync(getRemoteConcatCall(TEST_STRING_2, TEST_STRING_1),new IRemoteCallListener(){
      public void handleEvent(IRemoteCallEvent event) {
        if (event instanceof IRemoteCallCompleteEvent) {
          result = (String) ((IRemoteCallCompleteEvent) event).getResponse();
        }
      }
View Full Code Here

Examples of org.eclipse.ecf.remoteservice.IRemoteService.callAsync()

  public void testSimpleClientAndServerWithFuture() throws Exception {

    IRemoteService remoteService = client.getRemoteService();
    assertNotNull(remoteService);
    // Use callSync
    IFuture future = remoteService.callAsync(getRemoteConcatCall(TEST_STRING_2, TEST_STRING_1));
    assertNotNull(future);
    String result = (String) future.get();
    assertTrue(result.equals(TEST_STRING_2+TEST_STRING_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.