public class Channel<T> extends Object implements SelectableChannelInput<T>, ChannelOutput<T>
| Modifier and Type | Field and Description |
|---|---|
protected MultiInputSelector |
alt
The Alternative class which will control the selection
|
protected ChannelValueStore<T> |
data
The ChannelValueStore used to store the data for the Channel
|
protected Object |
monitor
The monitor reads must synchronize on
|
protected Object |
readMonitor
The monitor reads must synchronize on
|
protected Object |
writeMonitor
The monitor writes must synchronize on
|
AVAILABLE, CLOSED, EMPTY| Constructor and Description |
|---|
Channel()
Constructs a new Channel
|
Channel(ChannelValueStore<T> data)
Constructs a new Channel
|
Channel(String name) |
Channel(String name,
ChannelValueStore<T> data) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
disable() |
boolean |
enable(MultiInputSelector alt) |
String |
getName() |
boolean |
isClosed() |
Iterator<T> |
iterator() |
T |
read()
Reads an Object from the Channel.
|
T |
read(long timeout)
Reads an Object from the Channel.
|
void |
readConnect() |
void |
readDisconnect() |
String |
toString() |
void |
write(T value)
Writes an Object to the Channel.
|
void |
writeConnect() |
void |
writeDisconnect() |
protected MultiInputSelector alt
protected ChannelValueStore<T> data
protected Object monitor
protected Object readMonitor
protected Object writeMonitor
public Channel()
public Channel(ChannelValueStore<T> data)
data - The ChannelValueStore used to store the data for the Channelpublic Channel(String name)
public Channel(String name, ChannelValueStore<T> data)
public void close()
public boolean disable()
disable in interface SelectableInputpublic boolean enable(MultiInputSelector alt)
enable in interface SelectableInputpublic String getName()
public boolean isClosed()
isClosed in interface SelectableInputpublic T read()
read in interface ChannelInput<T>public T read(long timeout)
read in interface ChannelInput<T>timeout - The maximum time to wait in milliseconds.public void readConnect()
readConnect in interface ChannelInput<T>public void readDisconnect()
readDisconnect in interface ChannelInput<T>public void write(T value)
write in interface ChannelOutput<T>value - The object to write to the Channel.public void writeConnect()
writeConnect in interface ChannelOutput<T>public void writeDisconnect()
writeDisconnect in interface ChannelOutput<T>Copyright © 2015 Revolution Systems Inc.. All rights reserved.