CommandInterrupter
public
class
CommandInterrupter
extends Object
java.lang.Object | |
↳ | com.android.tradefed.command.CommandInterrupter |
Service allowing TradeFederation commands to be interrupted or marked as uninterruptible.
Summary
Fields | |
---|---|
public
static
final
CommandInterrupter |
INSTANCE
Singleton. |
Public constructors | |
---|---|
CommandInterrupter()
|
Public methods | |
---|---|
void
|
allowInterrupt()
Allow current thread to be interrupted. |
|
allowInterruptAsync(Thread thread, long delay, TimeUnit unit)
Allow a specified thread to be interrupted after a delay. |
void
|
blockInterrupt()
Prevent current thread from being interrupted. |
void
|
checkInterrupted()
Interrupts the current thread if it should be interrupted. |
void
|
interrupt(Thread thread, String message, ErrorIdentifier errorId)
Flag a thread, interrupting it if and when it becomes interruptible. |
boolean
|
isInterruptible(Thread thread)
|
boolean
|
isInterruptible()
|
Fields
Public constructors
CommandInterrupter
public CommandInterrupter ()
Public methods
allowInterrupt
public void allowInterrupt ()
Allow current thread to be interrupted.
allowInterruptAsync
publicallowInterruptAsync (Thread thread, long delay, TimeUnit unit)
Allow a specified thread to be interrupted after a delay.
Parameters | |
---|---|
thread |
Thread : thread to mark as interruptible |
delay |
long : time from now to delay execution |
unit |
TimeUnit : time unit of the delay parameter |
Returns | |
---|---|
|
blockInterrupt
public void blockInterrupt ()
Prevent current thread from being interrupted.
checkInterrupted
public void checkInterrupted ()
Interrupts the current thread if it should be interrupted. Threads are encouraged to
periodically call this method in order to throw the right RunInterruptedException
.
Throws | |
---|---|
RunInterruptedException |
interrupt
public void interrupt (Thread thread, String message, ErrorIdentifier errorId)
Flag a thread, interrupting it if and when it becomes interruptible.
Parameters | |
---|---|
thread |
Thread : thread to mark for interruption |
message |
String : interruption message |
errorId |
ErrorIdentifier |
isInterruptible
public boolean isInterruptible (Thread thread)
Parameters | |
---|---|
thread |
Thread |
Returns | |
---|---|
boolean |
true if specified thread is interruptible |
isInterruptible
public boolean isInterruptible ()
Returns | |
---|---|
boolean |
true if current thread is interruptible |