class Net2AnyChannel extends java.lang.Object implements NetSharedChannelInput, Networked
Modifier and Type | Field and Description |
---|---|
private RejectableChannel |
ch
The local channel used for output from the recieving process
|
private java.lang.String |
label
The channel name.
|
private NetChannelInputProcess |
netChannelInputProcess |
Constructor and Description |
---|
Net2AnyChannel()
Creates an anonymous input channel.
|
Net2AnyChannel(ChannelDataStore buffer)
Creates an anonymous, buffered input channel.
|
Net2AnyChannel(java.lang.String label) |
Net2AnyChannel(java.lang.String label,
ChannelDataStore buffer) |
Modifier and Type | Method and Description |
---|---|
void |
destroyReader()
Destroys the channel end and frees any resources within
the JCSP.NET infrastructure.
|
void |
endRead()
End an extended rendezvous.
|
NetChannelLocation |
getChannelLocation()
Returns the location of the
Networked
ChannelInput . |
java.lang.Class |
getFactoryClass()
Returns a Class file of the factory used to construct the
channel end.
|
void |
poison(int strength)
Currently, network channels are unpoisonable so this method has no effect.
|
java.lang.Object |
read()
Read data from this channel.
|
java.lang.Object |
startRead()
Begin an extended rendezvous read from the channel.
|
private final java.lang.String label
private RejectableChannel ch
private NetChannelInputProcess netChannelInputProcess
public Net2AnyChannel(java.lang.String label) throws java.lang.NullPointerException
java.lang.NullPointerException
public Net2AnyChannel()
Creates an anonymous input channel.
To create writers that write to this channel, you need to call getChannelName() to get a valid name for this channel. You will need to use some other means (e.g. a named channel) to pass the channel name to the writing computer.
public Net2AnyChannel(ChannelDataStore buffer)
Creates an anonymous, buffered input channel.
To create writers that write to this channel, you need to call getChannelName() to get a valid name for this channel. You will need to use some other means (e.g. a named channel) to pass the channel name to the writing computer.
buffer
- The ChannelDataStore to use.public Net2AnyChannel(java.lang.String label, ChannelDataStore buffer)
public java.lang.Object read()
read
in interface ChannelInput
public java.lang.Object startRead()
ChannelInput
endRead
.
Only then will the writer be released (from its
write
method).
The writer is unaware of the extended nature of the communication.
The reader process must call
at some point after this function, otherwise the writer will not
be freed and deadlock will probably follow.
endRead
The reader process may perform any actions between calling
and
startRead
, including communications
on other channels. Further communications on this channel, of course,
should not be made.
endRead
An extended rendezvous may be started after the channel's Guard
has been selected by an Alternative
(i.e.
instead of
startRead
).read
startRead
in interface ChannelInput
public void endRead()
ChannelInput
startRead
.endRead
in interface ChannelInput
public void poison(int strength)
poison
in interface Poisonable
strength
- the strength of the poison (must be >= 0).public NetChannelLocation getChannelLocation()
Networked
Networked
ChannelInput
.getChannelLocation
in interface Networked
NetChannelLocation
object.public java.lang.Class getFactoryClass()
NetChannelInput
Returns a Class file of the factory used to construct the channel end.
getFactoryClass
in interface NetChannelInput
Class
of the factory class.public void destroyReader()
NetChannelInput
Destroys the channel end and frees any resources within the JCSP.NET infrastructure.
destroyReader
in interface NetChannelInput