11.07.2015 Views

System Introspection for System Analysis on Mobile Devices

System Introspection for System Analysis on Mobile Devices

System Introspection for System Analysis on Mobile Devices

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

is received c<strong>on</strong>taining the TAG of the comp<strong>on</strong>ent thread. Passed to this methodis the receivedProperties map c<strong>on</strong>taining all extracted value pairs of themessage. The list can be used <str<strong>on</strong>g>for</str<strong>on</strong>g> further processing of client commands insidethe comp<strong>on</strong>ent thread (e.g. setting a navigati<strong>on</strong> goal <str<strong>on</strong>g>for</str<strong>on</strong>g> the robot).Each comp<strong>on</strong>ent thread holds an attribute showing its current state (see chapter5.2). When a comp<strong>on</strong>ent thread is created it is first put into the SLEEPstate due to no c<strong>on</strong>nected clients. Inactive comp<strong>on</strong>ent threads are not activelyreading data and can <strong>on</strong>ly be activated by the Comp<strong>on</strong>entDispatcher.When a new client c<strong>on</strong>nects and the comp<strong>on</strong>ent thread is activated by theComp<strong>on</strong>entDispatcher the state is changed to RUNNING. While active collecteddata is <str<strong>on</strong>g>for</str<strong>on</strong>g>warded to clients in the c<strong>on</strong>nectedClients list. Wheneverthe comp<strong>on</strong>ent thread receives an error from the comp<strong>on</strong>ent holder or an erroroccurs inside the defined methods, the state of the comp<strong>on</strong>ent thread changesto ERROR and the comp<strong>on</strong>ent thread gets deactivated. Comp<strong>on</strong>ent threads inerror state are not collecting data and cannot be activated. In the currentimplementati<strong>on</strong> comp<strong>on</strong>ent threads in ERROR state can <strong>on</strong>ly be activated byrestarting the probe.LogDispatcherThe LogDispatcher class c<strong>on</strong>trols the creati<strong>on</strong> of logging cycles. It uses theC<strong>on</strong>stants class with enumerati<strong>on</strong>s <str<strong>on</strong>g>for</str<strong>on</strong>g> commands to handle clients requests.The LogDispatcher holds a reference to the globalClients list and theloggingList c<strong>on</strong>taining clients currently running logging cycles. To sendmessages a reference to the Communicator is stored and <str<strong>on</strong>g>for</str<strong>on</strong>g> receiving messagesthe LogDispatcher observes the Communicator. The list of availablelogging comp<strong>on</strong>ents is parsed from the ServerC<strong>on</strong>fig. On request by a clientthe LogDispatcher offers a list of available logging comp<strong>on</strong>ents. When aclient requests a new logging cycle, the LogDispatcher parses the incomingmessage and extracts all requested comp<strong>on</strong>ents to be logged. Once parsed theLogDispatcher creates a new LogThread, passes all requested logging comp<strong>on</strong>entsto this thread and executes it. When the client requests to stop thelogging cycle the LogDispatcher checks the loggingList <str<strong>on</strong>g>for</str<strong>on</strong>g> a corresp<strong>on</strong>dingLogThread and interrupts it. In case of a notify from the list of all clients c<strong>on</strong>cerninga clients disc<strong>on</strong>nect the loggingList gets parsed and logging cycles<str<strong>on</strong>g>for</str<strong>on</strong>g> the client get interrupted.40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!