MonitorThread

public final class MonitorThread
extends Object

java.lang.Object
   ↳ com.android.tradefed.device.server.MonitorThread


Monitor open connections.

Summary

Public methods

void addClient(ClientImpl client)

Add a new Client to the list of things we monitor.

static MonitorThread createInstance()

Creates and return the singleton instance of the client monitor thread.

void dropClient(ClientImpl client, boolean notify)

Drops a client from the monitor.

void dropClients( clients, boolean notify)

Drops the provided list of clients from the monitor.

DdmJdwpExtension getDdmExtension()
static MonitorThread getInstance()

Get singleton instance of the client monitor thread.

boolean getRetryOnBadHandshake()

Returns "true" if we want to retry connections to clients if we get a bad JDWP handshake back, "false" if we want to just mark them as bad and leave them alone.

void quit()

Tell the thread to stop.

void registerChunkHandler(int type, ChunkHandler handler)

Register "handler" as the handler for type "type".

void run()

Watch for activity from clients and debuggers.

Public methods

addClient

public void addClient (ClientImpl client)

Add a new Client to the list of things we monitor. Also adds the client's channel and the client's debugger listener to the selection list. This should only be called from one thread (the VMWatcherThread) to avoid a race between "alreadyOpen" and Client creation.

Parameters
client ClientImpl

createInstance

public static MonitorThread createInstance ()

Creates and return the singleton instance of the client monitor thread.

Returns
MonitorThread

dropClient

public void dropClient (ClientImpl client, 
                boolean notify)

Drops a client from the monitor.

This will lock the ClientImpl list of the IDevice running client.

dropClients

public void dropClients ( clients, 
                boolean notify)

Drops the provided list of clients from the monitor. This will lock the ClientImpl list of the IDevice running each of the clients.

Parameters
clients

notify boolean

getDdmExtension

public DdmJdwpExtension getDdmExtension ()

Returns
DdmJdwpExtension

getInstance

public static MonitorThread getInstance ()

Get singleton instance of the client monitor thread.

Returns
MonitorThread

getRetryOnBadHandshake

public boolean getRetryOnBadHandshake ()

Returns "true" if we want to retry connections to clients if we get a bad JDWP handshake back, "false" if we want to just mark them as bad and leave them alone.

Returns
boolean

quit

public void quit ()

Tell the thread to stop. Called from UI thread.

registerChunkHandler

public void registerChunkHandler (int type, 
                ChunkHandler handler)

Register "handler" as the handler for type "type".

Parameters
type int

handler ChunkHandler

run

public void run ()

Watch for activity from clients and debuggers.