class RejectableAltingChannelInputImpl extends RejectableAltingChannelInput
| Modifier and Type | Field and Description |
|---|---|
private ChannelInternals |
channel |
private int |
immunity |
| Constructor and Description |
|---|
RejectableAltingChannelInputImpl(ChannelInternals _channel,
int _immunity) |
| Modifier and Type | Method and Description |
|---|---|
(package private) boolean |
disable()
Disables the guard for selection.
|
(package private) boolean |
enable(Alternative alt)
Returns true if the event is ready.
|
void |
endRead()
End an extended rendezvous.
|
boolean |
pending()
Returns whether there is data pending on this channel.
|
void |
poison(int strength)
This injects poison into the channel.
|
java.lang.Object |
read()
Read an Object from the channel.
|
void |
reject()
Reject any data pending instead of reading it.
|
java.lang.Object |
startRead()
Begin an extended rendezvous read from the channel.
|
private ChannelInternals channel
private int immunity
RejectableAltingChannelInputImpl(ChannelInternals _channel, int _immunity)
public boolean pending()
AltingChannelInputNote: if there is, it won't go away until you read it. But if there isn't, there may be some by the time you check the result of this method.
pending in class AltingChannelInputboolean disable()
GuardNote: this method should only be called by the Alternative class
boolean enable(Alternative alt)
GuardNote: this method should only be called by the Alternative class
public void endRead()
ChannelInputstartRead.public java.lang.Object read()
ChannelInputpublic java.lang.Object startRead()
ChannelInputendRead.
Only then will the writer be released (from its
write method).
The writer is unaware of the extended nature of the communication.
The reader process must call
at some point after this function, otherwise the writer will not
be freed and deadlock will probably follow.
endRead
The reader process may perform any actions between calling
and
startRead, including communications
on other channels. Further communications on this channel, of course,
should not be made.
endRead
An extended rendezvous may be started after the channel's Guard
has been selected by an Alternative (i.e.
instead of
startRead).read
public void poison(int strength)
Poisonablestrength - the strength of the poison (must be >= 0).public void reject()
RejectableAltingChannelInputChannelDataRejectedException.reject in interface RejectableChannelInputreject in class RejectableAltingChannelInput