public class ThreadChannel extends NativeThreadChannel implements IChannel
IChannel| Modifier and Type | Class and Description |
|---|---|
static class |
ThreadChannel.ChannelRequestQueueFullException |
static class |
ThreadChannel.ChannelSendFailureException |
| Constructor and Description |
|---|
ThreadChannel() |
ThreadChannel(long threadId,
long spyPort)
Creates a channel with a given
threadId and a handle to the SpyPort. |
| Modifier and Type | Method and Description |
|---|---|
long |
getThreadId() |
boolean |
isAlive()
Is the channel still alive? That is, is the thread and underlying SpyPort still active?
|
boolean |
isCurrentChannel()
Determines whether this channel is the current channel.
|
boolean |
isUnresponsive() |
void |
open()
Opens the channel.
|
void |
post(ChannelRunnable runnable)
Sends a request to be executed asychronously on this channel.
|
java.lang.Object |
send(ChannelRunnable request)
Sends a request to be executed sychronously on this channel.
|
void |
setUnresponsive(boolean unresponsive)
Mark the channel as unresponsive, usually after a message times out.
|
protected boolean |
waitForResponse(ChannelRunnable request) |
activate, getSpyport, isAlive, isUnresponsive, pumpSendMessages, setUnresponsivepublic ThreadChannel(long threadId,
long spyPort)
threadId and a handle to the SpyPort.
This constructor is used by native code.public ThreadChannel()
public long getThreadId()
public java.lang.Object send(ChannelRunnable request)
ChannelRunnable abstract class. The desired code
is placed in the send method.
If an exception is thrown while executing
on the channel, it is captured and rethrown.send in interface IChannelChannelRunnableprotected boolean waitForResponse(ChannelRunnable request)
public void post(ChannelRunnable runnable)
public boolean isCurrentChannel()
isCurrentChannel in interface IChanneltrue when running on the current channel.public void open()
public boolean isUnresponsive()
public void setUnresponsive(boolean unresponsive)
IChannelsetUnresponsive in interface IChannel