public class

RemoteManager

extends Thread
java.lang.Object
   ↳ java.lang.Thread
     ↳ com.android.tradefed.command.RemoteManager

Class Overview

Class that receives remote commands to add and remove devices from use via a socket.

Currently accepts only one remote connection at one time, and processes incoming commands serially.

Usage:

 RemoteManager r = new RemoteManager(deviceMgr, scheduler);
 r.start();
 int port = r.getPort();
 ... inform client of port to use. Shuts down when instructed by client or on #cancel()
 

Summary

[Expand]
Inherited Constants
From class java.lang.Thread
Public Constructors
RemoteManager(IDeviceManager manager, ICommandScheduler scheduler)
Creates a RemoteManager.
Public Methods
synchronized void cancel()
Cancel the remote manager.
synchronized int getPort()
Gets the socket port the remote manager is listening on, blocking for a short time if necessary.
boolean isCanceled()
void run()
The main thread body of the remote manager.
[Expand]
Inherited Methods
From class java.lang.Thread
From class java.lang.Object
From interface java.lang.Runnable

Public Constructors

public RemoteManager (IDeviceManager manager, ICommandScheduler scheduler)

Creates a RemoteManager.

Parameters
manager the IDeviceManager to use to allocate and free devices.
scheduler the ICommandScheduler to use to schedule commands.

Public Methods

public synchronized void cancel ()

Cancel the remote manager.

public synchronized int getPort ()

Gets the socket port the remote manager is listening on, blocking for a short time if necessary.

start() should be called before this method.

public boolean isCanceled ()

Returns
  • true if a cancel has been requested

public void run ()

The main thread body of the remote manager.

Creates a server socket, and waits for client connections.