public abstract class AbstractBbqChannel extends Object implements JslipcChannel, InterruptibleChannel, TimeoutAware
ByteBufferQueue
based channels.JslipcChannel.JslipcChannelState
Modifier and Type | Field and Description |
---|---|
protected boolean |
closed |
protected ByteBufferQueue |
queue |
Constructor and Description |
---|
AbstractBbqChannel(ByteBufferQueue queue) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkClosed() |
void |
close() |
JslipcChannel.JslipcChannelState |
getState() |
int |
getTimeout() |
boolean |
isOpen() |
void |
setTimeout(int timeout)
Sets the timeout to wait on blocking operations.
|
protected void |
sleep(long waitingSince)
Sleeps for the default time and watches for timeouts.
|
protected void |
waitForInitialization() |
protected void |
waitForNonEmpty() |
protected void |
waitForNonFull() |
protected volatile ByteBufferQueue queue
protected volatile boolean closed
public AbstractBbqChannel(ByteBufferQueue queue)
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Channel
close
in interface InterruptibleChannel
IOException
public JslipcChannel.JslipcChannelState getState()
getState
in interface JslipcChannel
state
of the channel.protected void checkClosed() throws ClosedChannelException
ClosedChannelException
public int getTimeout()
getTimeout
in interface TimeoutAware
public void setTimeout(int timeout)
TimeoutAware
setTimeout
in interface TimeoutAware
protected void sleep(long waitingSince) throws InterruptedIOException
waitingSince
- the timestamp when the operation started to block.InterruptedIOException
protected void waitForInitialization() throws InterruptedIOException
InterruptedIOException
protected void waitForNonEmpty() throws InterruptedIOException
InterruptedIOException
protected void waitForNonFull() throws InterruptedIOException
InterruptedIOException
Copyright © 2014. All Rights Reserved.