명령 인터럽터

public class CommandInterrupter
extends Object

java.lang.객체
com.android.tradefed.command.CommandInterrupter


TradeFederation 명령을 중단하거나 중단할 수 없는 것으로 표시할 수 있는 서비스입니다.

요약

필드

public static final CommandInterrupter INSTANCE

하나씩 일어나는 것.

공개 생성자

CommandInterrupter ()

공개 방법

void allowInterrupt ()

현재 스레드가 중단되도록 허용합니다.

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 ()

필드

사례

public static final CommandInterrupter INSTANCE

하나씩 일어나는 것.

공개 생성자

명령 인터럽터

public CommandInterrupter ()

공개 방법

allowInterrupt

public void allowInterrupt ()

현재 스레드가 중단되도록 허용합니다.

allowInterruptAsync

public  allowInterruptAsync (Thread thread, 
                long delay, 
                TimeUnit unit)

지정된 스레드가 지연 후 중단되도록 허용합니다.

매개변수
thread Thread : 인터럽트 가능으로 표시할 스레드

delay long : 지금부터 실행을 지연시킬 시간

unit TimeUnit : 지연 파라미터의 시간 단위

보고

blockInterrupt

public void blockInterrupt ()

현재 스레드가 중단되는 것을 방지합니다.

확인 중단됨

public void checkInterrupted ()

중단해야 하는 경우 현재 스레드를 중단합니다. 올바른 RunInterruptedException 발생시키기 위해 스레드는 주기적으로 이 메서드를 호출하는 것이 좋습니다.

던지기
RunInterruptedException

방해하다

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 현재 스레드가 인터럽트 가능한 경우 true