CommandInterrupter

public class CommandInterrupter
extends Object

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


यह सेवा, TradeFederation के निर्देशों को बीच में रोकने या उन्हें 'बीच में नहीं रोका जा सकता' के तौर पर मार्क करने की अनुमति देती है.

खास जानकारी

फ़ील्ड

public static final CommandInterrupter INSTANCE

सिंगलटन.

सार्वजनिक कंस्ट्रक्टर

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

सिंगलटन.

सार्वजनिक कंस्ट्रक्टर

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 अगर मौजूदा थ्रेड को बीच में रोका जा सकता है, तो वैल्यू 'सही' के तौर पर सेट होगी