subject

Import com. programix. thread.*; /**
* StringHandoff is used to pass a String from one thread to another.
* The passer and the receiver meet inside an instance for the handoff.
* For example, if pass() is called and there is not receiver waiting, the
* thread calling pass() will block until the receiver arrives. Similarly,
* if receive() is called and there is no passer waiting, the thread calling
* receive() will block until the passer arrives.
*
* There can only be one thread waiting to pass at any given time. If a second
* thread tries to call pass() when another thread is already waiting to pass,
* an IllegalStateException is thrown. Similarly, there can only be one thread
* waiting to receive at any given time. If a second thread tries to call
* receive() when another thread is already waiting to receive, an
* IllegalStateException is thrown. IllegalStateException is a RuntimeException.
*
* Methods that take a timeout parameter will throw a TimedOutException if
* the specified number of milliseconds passes without the handoff occurring.
* TimedOutException is a RuntimeException.
*
* The methods that declare that they may throw a ShutdownException will do
* so after shutdown() has been called. If a thread is waiting inside a method
* and another thread calls shutdown(), then the waiting thread will throw
* a ShutdownException. If a thread calls a method that declares that it may
* throw a ShutdownException, and any thread has already called shutdown(), then
* the call will immediately throw the ShutdownException.
* ShutdownException is a RuntimeException.
*/
public interface StringHandoff {
void pass(String msg, long msTimeout) throws InterruptedException,
TimedOutException,
ShutdownException,
IllegalStateException;
void pass(String msg) throws InterruptedException,
ShutdownException,
IllegalStateException;
String receive(long msTimeout) throws InterruptedException,
TimedOutException,
ShutdownException,
IllegalStateException;
String receive() throws InterruptedException,
ShutdownException,
IllegalStateException;
void shutdown();
Object getLockObject();
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 05:20
What did creator markus “notch" persson initially call his game
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
What provides an array of buttons for quick access to commonly used commands and tools
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. which step can possibly increase the severity of an incident? a. separating sensitive data from non-sensitive data b. immediately spreading the news about the incident response plan c. installing new hard disks d. increasing access controls
Answers: 2
question
Computers and Technology, 24.06.2019 03:30
Auniform resource locator (url) is a formatted string of text that web browsers, email applications, and other software programs use to identify a particular resource on the internet. true false
Answers: 2
You know the right answer?
Import com. programix. thread.*; /**
* StringHandoff is used to pass a String from one thread...
Questions
question
Social Studies, 30.08.2019 16:30
question
Computers and Technology, 30.08.2019 16:30
Questions on the website: 13722361