public final class MobileChannelInput extends java.lang.Object implements NetChannelInput, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private NetChannelInput |
actualIn |
private NetChannelLocation |
messageBoxLoc |
private NetChannelLocation |
msgBoxReqLoc |
private NetChannelOutput |
toMessageBox |
Constructor and Description |
---|
MobileChannelInput() |
MobileChannelInput(NetworkMessageFilter.FilterTx encoder,
NetworkMessageFilter.FilterRx decoder) |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys the Networked construct
|
void |
endRead()
End an extended rendezvous.
|
NetLocation |
getLocation()
Gets the networked location of the Networked construct
|
void |
poison(int strength)
This injects poison into the channel.
|
java.lang.Object |
read()
Read an Object from the channel.
|
private void |
readObject(java.io.ObjectInputStream input) |
void |
setDecoder(NetworkMessageFilter.FilterRx decoder)
Sets the underlying decoder for the channel
|
java.lang.Object |
startRead()
Begin an extended rendezvous read from the channel.
|
private void |
writeObject(java.io.ObjectOutputStream output) |
private NetChannelLocation messageBoxLoc
private NetChannelLocation msgBoxReqLoc
private transient NetChannelInput actualIn
private transient NetChannelOutput toMessageBox
public MobileChannelInput()
public MobileChannelInput(NetworkMessageFilter.FilterTx encoder, NetworkMessageFilter.FilterRx decoder)
public void endRead()
ChannelInput
startRead
.endRead
in interface ChannelInput
public java.lang.Object read()
ChannelInput
read
in interface ChannelInput
public java.lang.Object startRead()
ChannelInput
endRead
.
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
startRead
in interface ChannelInput
public void poison(int strength)
Poisonable
poison
in interface Poisonable
strength
- the strength of the poison (must be >= 0).public void destroy()
Networked
public NetLocation getLocation()
Networked
getLocation
in interface Networked
public void setDecoder(NetworkMessageFilter.FilterRx decoder)
NetChannelInput
setDecoder
in interface NetChannelInput
decoder
- The new decoder to use.private void writeObject(java.io.ObjectOutputStream output) throws java.io.IOException
java.io.IOException
private void readObject(java.io.ObjectInputStream input) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException