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.String
label
private NetChannelInputProcess
netChannelInputProcess
-
Constructor Summary
Constructors Modifier Constructor Description private
Net2OneChannel(java.lang.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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkPoison()
Currently, network channels are unpoisonable so this method will never throw a PoisonException(package private) static Net2OneChannel
create()
(package private) static Net2OneChannel
create(java.lang.String label)
(package private) static Net2OneChannel
create(java.lang.String label, ChannelDataStore buffer)
(package private) static Net2OneChannel
create(ChannelDataStore buffer)
void
destroyReader()
Destroys this end of the channel.protected AltingChannelInput
getChannel()
This method should not be called.(package private) long
getChannelIndex()
NetChannelLocation
getChannelLocation()
Returns a newNetChannelLocation
object which holds the information necessary for a networkedChannelOutput
to establish a connection to this channel reader.java.lang.Class
getFactoryClass()
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 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.IllegalArgumentException
Creates 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 anull
reference.
-
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 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
protected AltingChannelInput 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
public java.lang.Class 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
public void poison(PoisonException poison)
Currently, network channels are unpoisonable so this method has no effect.
-
checkPoison
public void checkPoison() throws PoisonException
Currently, network channels are unpoisonable so this method will never throw a PoisonException- Throws:
PoisonException
-
-