Package org.jcsp.net
Class Net2OneChannel
java.lang.Object
org.jcsp.lang.Guard
org.jcsp.lang.AltingChannelInput
org.jcsp.lang.AltingChannelInputWrapper
org.jcsp.net.NetAltingChannelInput
org.jcsp.net.Net2OneChannel
- All Implemented Interfaces:
ChannelInput,Poisonable,NetChannelInput,Networked
A channel for network input (RX). This is a "Net2One" channel,
which can only be used by one reader at a time.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNet2OneChannel(String label, AltingChannelInput actualChan, RejectableChannel ch) Creates a channel which receives data on a labelled VCN.privateNet2OneChannel(AltingChannelInput actualChan, RejectableChannel ch) Creates a zero-buffered channel reader. -
Method Summary
Modifier and TypeMethodDescriptionvoidCurrently, network channels are unpoisonable so this method will never throw a PoisonException(package private) static Net2OneChannelcreate()(package private) static Net2OneChannel(package private) static Net2OneChannelcreate(String label, ChannelDataStore buffer) (package private) static Net2OneChannelcreate(ChannelDataStore buffer) voidDestroys this end of the channel.protected AltingChannelInputThis method should not be called.(package private) longReturns a newNetChannelLocationobject which holds the information necessary for a networkedChannelOutputto establish a connection to this channel reader.Returns a Class file of the factory used to construct the channel end.voidpoison(PoisonException poison) Currently, network channels are unpoisonable so this method has no effect.Methods inherited from class org.jcsp.lang.AltingChannelInputWrapper
endRead, pending, poison, read, setChannel, startReadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jcsp.lang.ChannelInput
endRead, read, startReadMethods inherited from interface org.jcsp.lang.Poisonable
poison
-
Field Details
-
label
-
netChannelInputProcess
-
-
Constructor Details
-
Net2OneChannel
private Net2OneChannel(String label, AltingChannelInput actualChan, RejectableChannel ch) throws IllegalArgumentException Creates a channel which receives data on a labelled VCN.- Parameters:
label- The label to apply to this channel's VCN.- Throws:
IllegalArgumentException- if the label supplied is anullreference.
-
Net2OneChannel
Creates a zero-buffered channel reader. ThegetChannelLocation()method can be called to obtain the location information of the constructed channel.
-
-
Method Details
-
create
-
create
-
create
-
create
-
getChannelLocation
Returns a newNetChannelLocationobject which holds the information necessary for a networkedChannelOutputto establish a connection to this channel reader.- Returns:
- the location information for this channel reader.
-
destroyReader
public void destroyReader()Destroys this end of the channel. -
getChannel
This method should not be called. The implementation channel is not available to subclasses of Net2OneChannel.- Overrides:
getChannelin classAltingChannelInputWrapper- Returns:
- Always null.
-
getChannelIndex
long getChannelIndex() -
getFactoryClass
Description copied from interface:NetChannelInputReturns a Class file of the factory used to construct the channel end.
- Returns:
- the
Classof the factory class.
-
poison
Currently, network channels are unpoisonable so this method has no effect. -
checkPoison
Currently, network channels are unpoisonable so this method will never throw a PoisonException- Throws:
PoisonException
-