Methods Summary |
---|
public native void | close()
|
public boolean | equals(java.lang.Object obj)
return
obj instanceof Link
&& ((Link)obj).nativePointer == this.nativePointer;
|
private native void | finalize()
|
public int | hashCode()
return nativePointer;
|
private native void | init0(int sender, int receiver)
|
public native boolean | isOpen()
|
public static com.sun.midp.links.Link | newLink(com.sun.cldc.isolate.Isolate sender, com.sun.cldc.isolate.Isolate receiver)
int rid = receiver.id(); // throws NullPointerException
int sid = sender.id(); // throws NullPointerException
if (rid == -1 || sid == -1
|| receiver.isTerminated() || sender.isTerminated() ) {
throw new IllegalStateException();
}
/*
* IMPL_NOTE - this has race conditions. One of the isolates can
* change state between the test and the call to init0().
*/
Link link = new Link();
link.init0(sender.id(), receiver.id());
return link;
|
public LinkMessage | receive()Throws IllegalArgumentException if the calling thread is not in the
receiving isolate for this link.
(Note: this differs from the JSR-121 specification, which states that
UnsupportedOperationException should be thrown in this case. That
exception doesn't appear in CLDC, so IllegalArgumentException is thrown
instead.)
Link emptyLink;
LinkMessage msg = new LinkMessage();
synchronized (this) {
if (emptyLinkCache == null) {
emptyLink = new Link();
} else {
emptyLink = emptyLinkCache;
emptyLinkCache = null;
}
}
receive0(msg, emptyLink);
if (!msg.containsLink()) {
synchronized (this) {
if (emptyLinkCache == null) {
emptyLinkCache = emptyLink;
}
}
}
return msg;
|
private native void | receive0(LinkMessage msg, com.sun.midp.links.Link link)
|
public void | send(LinkMessage lm)Throws IllegalArgumentException if the calling thread is not in the
sending isolate for this link.
(Note: this differs from the JSR-121 specification, which states that
UnsupportedOperationException should be thrown in this case. That
exception doesn't appear in CLDC, so IllegalArgumentException is thrown
instead.)
if (lm == null) {
throw new NullPointerException();
}
send0(lm);
|
private native void | send0(LinkMessage msg)
|