Package soot.jimple.infoflow.memory
Class FlowDroidTimeoutWatcher
java.lang.Object
soot.jimple.infoflow.memory.FlowDroidTimeoutWatcher
- All Implemented Interfaces:
IMemoryBoundedSolver.IMemoryBoundedSolverStatusNotification
public class FlowDroidTimeoutWatcher
extends Object
implements IMemoryBoundedSolver.IMemoryBoundedSolverStatusNotification
Class for enforcing timeouts on IFDS solvers
- Author:
- Steven Arzt
-
Constructor Summary
ConstructorsConstructorDescriptionFlowDroidTimeoutWatcher(long timeout) Creates a new instance of theFlowDroidTimeoutWatcherclassFlowDroidTimeoutWatcher(long timeout, InfoflowResults res) Creates a new instance of theFlowDroidTimeoutWatcherclass -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSolver(IMemoryBoundedSolver solver) Adds a solver that shall be terminated when the timeout is reachedlongGets the timeout after which the IFDS solvers are abortedvoidMethod that is called when the solver has received its first taskvoidMethod that is called when the solver has finished its last taskvoidreset()Resets the internal state of the watcher so that it can be used again after being stoppedvoidsetTerminationCallback(ISolversTerminatedCallback terminationCallback) Sets a callback that shall be invoked when the solvers have been terminated due to a timeoutvoidstart()Starts the timeout watchervoidstop()Stops the timeout watcher so that it no longer interferes with solver execution
-
Constructor Details
-
FlowDroidTimeoutWatcher
public FlowDroidTimeoutWatcher(long timeout) Creates a new instance of theFlowDroidTimeoutWatcherclass- Parameters:
timeout- The timeout in seconds after which the solvers shall be stopped
-
FlowDroidTimeoutWatcher
Creates a new instance of theFlowDroidTimeoutWatcherclass- Parameters:
timeout- The timeout in seconds after which the solvers shall be stoppedres- The InfoflowResults object
-
-
Method Details
-
getTimeout
public long getTimeout()Gets the timeout after which the IFDS solvers are aborted- Returns:
- The timeout after which the IFDS solvers are aborted
-
addSolver
Adds a solver that shall be terminated when the timeout is reached- Parameters:
solver- A solver that shall be terminated when the timeout is reached
-
start
public void start()Starts the timeout watcher -
stop
public void stop()Stops the timeout watcher so that it no longer interferes with solver execution -
reset
public void reset()Resets the internal state of the watcher so that it can be used again after being stopped -
notifySolverStarted
Description copied from interface:IMemoryBoundedSolver.IMemoryBoundedSolverStatusNotificationMethod that is called when the solver has received its first task- Specified by:
notifySolverStartedin interfaceIMemoryBoundedSolver.IMemoryBoundedSolverStatusNotification- Parameters:
solver- The solver that sends the notification
-
notifySolverTerminated
Description copied from interface:IMemoryBoundedSolver.IMemoryBoundedSolverStatusNotificationMethod that is called when the solver has finished its last task- Specified by:
notifySolverTerminatedin interfaceIMemoryBoundedSolver.IMemoryBoundedSolverStatusNotification
-
setTerminationCallback
Sets a callback that shall be invoked when the solvers have been terminated due to a timeout- Parameters:
terminationCallback- The callback to invoke when the solvers have been terminated due to a timeout
-