CommandInterrupter

public class CommandInterrupter
extends Object

java.lang.Object
com.android.tradefed.command.CommandInterrupter


บริการที่อนุญาตให้ขัดจังหวะหรือทำเครื่องหมายคำสั่ง TradeFederation ว่าขัดจังหวะไม่ได้

สรุป

ทุ่ง

public static final CommandInterrupter INSTANCE

Singleton

เครื่องมือสร้างสาธารณะ

CommandInterrupter()

เมธอดสาธารณะ

void allowInterrupt()

อนุญาตให้ขัดจังหวะเธรดปัจจุบัน

Future<?> allowInterruptAsync(Thread thread, long delay, TimeUnit unit)

อนุญาตให้ขัดจังหวะเธรดที่ระบุหลังจากผ่านไปตามระยะเวลาที่กำหนด

void blockInterrupt()

ป้องกันไม่ให้ขัดจังหวะเธรดปัจจุบัน

void checkInterrupted()

ขัดจังหวะเธรดปัจจุบันหากควรขัดจังหวะ

void interrupt(Thread thread, String message, ErrorIdentifier errorId)

ทำเครื่องหมายเธรดและขัดจังหวะเธรดเมื่อเธรดนั้นขัดจังหวะได้

boolean isInterruptible(Thread thread)
boolean isInterruptible()

ทุ่ง

INSTANCE

public static final CommandInterrupter INSTANCE

Singleton

เครื่องมือสร้างสาธารณะ

CommandInterrupter

public CommandInterrupter ()

เมธอดสาธารณะ

allowInterrupt

public void allowInterrupt ()

อนุญาตให้ขัดจังหวะเธรดปัจจุบัน

allowInterruptAsync

public Future<?> allowInterruptAsync (Thread thread, 
                long delay, 
                TimeUnit unit)

อนุญาตให้ขัดจังหวะเธรดที่ระบุหลังจากผ่านไปตามระยะเวลาที่กำหนด

พารามิเตอร์
thread Thread: เธรดที่จะทำเครื่องหมายว่าขัดจังหวะได้

delay long: เวลาจากตอนนี้ที่จะหน่วงการดำเนินการ

unit TimeUnit: หน่วยเวลาของพารามิเตอร์การหน่วงเวลา

การคืนสินค้า
Future<?>

blockInterrupt

public void blockInterrupt ()

ป้องกันไม่ให้ขัดจังหวะเธรดปัจจุบัน

checkInterrupted

public void checkInterrupted ()

ขัดจังหวะเธรดปัจจุบันหากควรขัดจังหวะ เราขอแนะนำให้เธรดเรียกใช้เมธอดนี้เป็นระยะๆ เพื่อให้แสดง RunInterruptedException ที่ถูกต้อง

ส่ง
RunInterruptedException

interrupt

public void interrupt (Thread thread, 
                String message, 
                ErrorIdentifier errorId)

ทำเครื่องหมายเธรดและขัดจังหวะเธรดเมื่อเธรดนั้นขัดจังหวะได้

พารามิเตอร์
thread Thread: เธรดที่จะทำเครื่องหมายเพื่อขัดจังหวะ

message String: ข้อความขัดจังหวะ

errorId ErrorIdentifier

isInterruptible

public boolean isInterruptible (Thread thread)

พารามิเตอร์
thread Thread

การคืนสินค้า
boolean เป็นจริงหากเธรดที่ระบุขัดจังหวะได้

isInterruptible

public boolean isInterruptible ()

การคืนสินค้า
boolean เป็นจริงหากเธรดปัจจุบันขัดจังหวะได้