Package org.jcsp.net2.mobile
Class MobileChannelOutput
- java.lang.Object
-
- org.jcsp.net2.mobile.MobileChannelOutput
-
- All Implemented Interfaces:
Serializable,ChannelOutput,Poisonable,NetChannelOutput,Networked
public final class MobileChannelOutput extends Object implements NetChannelOutput, Serializable
- Author:
- Kevin
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MobileChannelOutput(NetChannelLocation loc)MobileChannelOutput(NetChannelLocation loc, NetworkMessageFilter.FilterTx encoder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidasyncWrite(Object obj)Sends a message to the input end of the channel asynchronously (no blocking)voiddestroy()Destroys the Networked constructNetLocationgetLocation()Gets the networked location of the Networked constructvoidpoison(int strength)This injects poison into the channel.voidsetEncoder(NetworkMessageFilter.FilterTx encoder)Sets the underlying encoder for the channelvoidwrite(Object object)Write an Object to the channel.
-
-
-
Constructor Detail
-
MobileChannelOutput
public MobileChannelOutput(NetChannelLocation loc)
-
MobileChannelOutput
public MobileChannelOutput(NetChannelLocation loc, NetworkMessageFilter.FilterTx encoder)
-
-
Method Detail
-
write
public void write(Object object)
Description copied from interface:ChannelOutputWrite an Object to the channel.- Specified by:
writein interfaceChannelOutput- Parameters:
object- the object to write to the channel
-
destroy
public void destroy()
Description copied from interface:NetworkedDestroys the Networked construct
-
getLocation
public NetLocation getLocation()
Description copied from interface:NetworkedGets the networked location of the Networked construct- Specified by:
getLocationin interfaceNetworked- Returns:
- The location of the construct
-
poison
public void poison(int strength)
Description copied from interface:PoisonableThis injects poison into the channel. If the channel was not explicitly constructed to be poisonable or if the strength of poison is not greater than the channel immunity level, the poison will have no effect.- Specified by:
poisonin interfacePoisonable- Parameters:
strength- the strength of the poison (must be >= 0).
-
asyncWrite
public void asyncWrite(Object obj) throws JCSPNetworkException, NetworkPoisonException
Description copied from interface:NetChannelOutputSends a message to the input end of the channel asynchronously (no blocking)- Specified by:
asyncWritein interfaceNetChannelOutput- Parameters:
obj- The object to send to the input end- Throws:
JCSPNetworkException- Thrown if something goes wrong in the underlying architectureNetworkPoisonException- Thrown if the channel is poisoned
-
setEncoder
public void setEncoder(NetworkMessageFilter.FilterTx encoder)
Description copied from interface:NetChannelOutputSets the underlying encoder for the channel- Specified by:
setEncoderin interfaceNetChannelOutput- Parameters:
encoder- The encoder to use for the channel.
-
-