CommandInterrupter

public class CommandInterrupter
extends Object

java.lang.Object
   ↳ 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

सिंगलटन.

पब्लिक कंस्ट्रक्टर

CommandInterrupter

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

मौजूदा थ्रेड में रुकावट न आए.

checkInterrupted

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

isInterruptible

public boolean isInterruptible ()

रिटर्न
boolean अगर मौजूदा थ्रेड को बीच में रोका जा सकता है, तो यह true दिखाता है