org.jcsp.net2.mobile
Class MobileChannelOutput

java.lang.Object
  extended by 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
MobileChannelOutput(NetChannelLocation loc)
           
MobileChannelOutput(NetChannelLocation loc, NetworkMessageFilter.FilterTx encoder)
           
 
Method Summary
 void asyncWrite(Object obj)
          Sends a message to the input end of the channel asynchronously (no blocking)
 void destroy()
          Destroys the Networked construct
 NetLocation getLocation()
          Gets the networked location of the Networked construct
 void poison(int strength)
          This injects poison into the channel.
 void setEncoder(NetworkMessageFilter.FilterTx encoder)
          Sets the underlying encoder for the channel
 void write(Object object)
          Write an Object to the channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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: ChannelOutput
Write an Object to the channel.

Specified by:
write in interface ChannelOutput
Parameters:
object - the object to write to the channel

destroy

public void destroy()
Description copied from interface: Networked
Destroys the Networked construct

Specified by:
destroy in interface Networked

getLocation

public NetLocation getLocation()
Description copied from interface: Networked
Gets the networked location of the Networked construct

Specified by:
getLocation in interface Networked
Returns:
The location of the construct

poison

public void poison(int strength)
Description copied from interface: Poisonable
This 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:
poison in interface Poisonable
Parameters:
strength - the strength of the poison (must be >= 0).

asyncWrite

public void asyncWrite(Object obj)
                throws JCSPNetworkException,
                       NetworkPoisonException
Description copied from interface: NetChannelOutput
Sends a message to the input end of the channel asynchronously (no blocking)

Specified by:
asyncWrite in interface NetChannelOutput
Parameters:
obj - The object to send to the input end
Throws:
JCSPNetworkException - Thrown if something goes wrong in the underlying architecture
NetworkPoisonException - Thrown if the channel is poisoned

setEncoder

public void setEncoder(NetworkMessageFilter.FilterTx encoder)
Description copied from interface: NetChannelOutput
Sets the underlying encoder for the channel

Specified by:
setEncoder in interface NetChannelOutput
Parameters:
encoder - The encoder to use for the channel.


Copyright © 1996-2012. All Rights Reserved.