javax.isolate.Link.receive()
Receives a copy of a message sent on this Link. The current thread will block in this method until a sender is available. When the sender and receiver rendezvous, the message will then be transferred. If multiple threads invoke this method on the same object, only one thread will receive any message at rendezvous and the other threads will contend for subsequent access to the rendezvous point. A normal return indicates that the message was received successfully. If an exception occured on the sender side, no rendezvous will occur, and no object will be transferred; the receiver will wait for the next successful send. If an exception occurs on the receive, the sender will see a successful transfer. This method never returns null. If the sending isolate becomes terminated after this method is invoked but before it returns, the link will be closed, a ClosedLinkException will be thrown, any subsequent attempts to use receive() will result in a ClosedLinkException, and any Isolate objects corresponding to the receive side of the link will reflect a terminated state. If invoked on a closed Link, this method will throw a ClosedLinkException. If close() is invoked on the link while a thread is blocked in receive(), receive() will throw a ClosedLinkException. No message will have been transferred in that case. If Thread.interrupt() is invoked on a thread that has not yet completed an invocation of this method, the results are undefined. An InterruptedIOException may or may not be thrown; if not, control will return from the method with a valid LinkMessage object. However, even if InterruptedIOException is thrown, rendezvous and data transfer from the sending isolate may have occurred. In particular, undetected message loss between sender and receiver may occur. If a failure occurs due to the object being transferred between isolates an IOException may be thrown in the receiver. For example, if a message containing a large buffer is sent and the receiver has insufficient heap memory for the buffer or if construction of a link in the receiver isolate fails, an IOException will be thrown. The sender will see a successful transfer in these cases. If the current isolate is not a receiver on this Link an IllegalStateException will be thrown. The receiver will not rendezvous with a sender in this case.
@return