FileDocCategorySizeDatePackage
DdmHandleExit.javaAPI DocAndroid 1.5 API2158Wed May 06 22:41:54 BST 2009android.ddm

DdmHandleExit

public class DdmHandleExit extends org.apache.harmony.dalvik.ddmc.ChunkHandler
Handle an EXIT chunk.

Fields Summary
public static final int
CHUNK_EXIT
private static DdmHandleExit
mInstance
Constructors Summary
private DdmHandleExit()



    /* singleton, do not instantiate */
      
Methods Summary
public voidconnected()
Called when the DDM server connects. The handler is allowed to send messages to the server.

public voiddisconnected()
Called when the DDM server disconnects. Can be used to disable periodic transmissions or clean up saved state.

public org.apache.harmony.dalvik.ddmc.ChunkhandleChunk(org.apache.harmony.dalvik.ddmc.Chunk request)
Handle a chunk of data. We're only registered for "EXIT".

        if (Config.LOGV)
            Log.v("ddm-exit", "Handling " + name(request.type) + " chunk");

        /*
         * Process the request.
         */
        ByteBuffer in = wrapChunk(request);

        int statusCode = in.getInt();

        Runtime.getRuntime().halt(statusCode);

        // if that doesn't work, return an empty message
        return null;
    
public static voidregister()
Register for the messages we're interested in.

        DdmServer.registerHandler(CHUNK_EXIT, mInstance);