Package org.jcsp.net
Class Net2OneChannel
- java.lang.Object
-
- org.jcsp.lang.Guard
-
- org.jcsp.lang.AltingChannelInput<T>
-
- org.jcsp.lang.AltingChannelInputWrapper
-
- org.jcsp.net.NetAltingChannelInput
-
- org.jcsp.net.Net2OneChannel
-
- All Implemented Interfaces:
ChannelInput,Poisonable,NetChannelInput,Networked
class Net2OneChannel extends NetAltingChannelInput
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 Modifier and Type Field Description private java.lang.Stringlabelprivate NetChannelInputProcessnetChannelInputProcess
-
Constructor Summary
Constructors Modifier Constructor Description privateNet2OneChannel(java.lang.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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckPoison()Currently, network channels are unpoisonable so this method will never throw a PoisonException(package private) static Net2OneChannelcreate()(package private) static Net2OneChannelcreate(java.lang.String label)(package private) static Net2OneChannelcreate(java.lang.String label, ChannelDataStore buffer)(package private) static Net2OneChannelcreate(ChannelDataStore buffer)voiddestroyReader()Destroys this end of the channel.protected AltingChannelInputgetChannel()This method should not be called.(package private) longgetChannelIndex()NetChannelLocationgetChannelLocation()Returns a newNetChannelLocationobject which holds the information necessary for a networkedChannelOutputto establish a connection to this channel reader.java.lang.ClassgetFactoryClass()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, 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 Detail
-
label
private final java.lang.String label
-
netChannelInputProcess
private NetChannelInputProcess netChannelInputProcess
-
-
Constructor Detail
-
Net2OneChannel
private Net2OneChannel(java.lang.String label, AltingChannelInput actualChan, RejectableChannel ch) throws java.lang.IllegalArgumentExceptionCreates a channel which receives data on a labelled VCN.- Parameters:
label- The label to apply to this channel's VCN.- Throws:
java.lang.IllegalArgumentException- if the label supplied is anullreference.
-
Net2OneChannel
private Net2OneChannel(AltingChannelInput actualChan, RejectableChannel ch)
Creates a zero-buffered channel reader. ThegetChannelLocation()method can be called to obtain the location information of the constructed channel.
-
-
Method Detail
-
create
static Net2OneChannel create(java.lang.String label)
-
create
static Net2OneChannel create()
-
create
static Net2OneChannel create(ChannelDataStore buffer)
-
create
static Net2OneChannel create(java.lang.String label, ChannelDataStore buffer)
-
getChannelLocation
public NetChannelLocation 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
protected AltingChannelInput 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
public java.lang.Class 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
public void poison(PoisonException poison)
Currently, network channels are unpoisonable so this method has no effect.
-
checkPoison
public void checkPoison() throws PoisonExceptionCurrently, network channels are unpoisonable so this method will never throw a PoisonException- Throws:
PoisonException
-
-