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
ConstructorsModifierConstructorDescriptionprivate
Net2OneChannel
(String label, AltingChannelInput actualChan, RejectableChannel ch) Creates a channel which receives data on a labelled VCN.private
Net2OneChannel
(AltingChannelInput actualChan, RejectableChannel ch) Creates a zero-buffered channel reader. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Currently, network channels are unpoisonable so this method will never throw a PoisonException(package private) static Net2OneChannel
create()
(package private) static Net2OneChannel
(package private) static Net2OneChannel
create
(String label, ChannelDataStore buffer) (package private) static Net2OneChannel
create
(ChannelDataStore buffer) void
Destroys this end of the channel.protected AltingChannelInput
This method should not be called.(package private) long
Returns a newNetChannelLocation
object which holds the information necessary for a networkedChannelOutput
to establish a connection to this channel reader.Returns a Class file of the factory used to construct the channel end.void
poison
(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, startRead
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jcsp.lang.ChannelInput
endRead, read, startRead
Methods 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 anull
reference.
-
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 newNetChannelLocation
object which holds the information necessary for a networkedChannelOutput
to 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:
getChannel
in classAltingChannelInputWrapper
- Returns:
- Always null.
-
getChannelIndex
long getChannelIndex() -
getFactoryClass
Description copied from interface:NetChannelInput
Returns a Class file of the factory used to construct the channel end.
- Returns:
- the
Class
of 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
-