IBM Rational Functional Tester
Version 8.1.1000
IBM Rational Functional Tester Proxy SDK Reference

Project Version 2.3

com.rational.test.ft.domain
Class ThreadChannel

java.lang.Object   extended by com.rational.test.ft.domain.NativeThreadChannel
      extended by com.rational.test.ft.domain.ThreadChannel
All Implemented Interfaces:
IChannel

public class ThreadChannel
extends NativeThreadChannel
implements IChannel

Implements a channel that provides thread affinity to a GUI thread. Channels allow code to be run on a specific thread.

Since:
RFT1.0
See Also:
IChannel

Nested Class Summary
static class ThreadChannel.ChannelRequestQueueFullException
           
static class ThreadChannel.ChannelSendFailureException
           
 
Constructor Summary
ThreadChannel()
           
ThreadChannel(long threadId, long spyPort)
          Creates a channel with a given threadId and a handle to the SpyPort.
 
Method Summary
 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)
           
 
Methods inherited from class com.rational.test.ft.domain.NativeThreadChannel
activate, getSpyport, isAlive, isUnresponsive, pumpSendMessages, setUnresponsive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadChannel

public ThreadChannel(long threadId,                      long spyPort)
Creates a channel with a given threadId and a handle to the SpyPort. This constructor is used by native code.

Since:
RFT1.0

ThreadChannel

public ThreadChannel()
Method Detail

getThreadId

public long getThreadId()

send

public java.lang.Object send(ChannelRunnable request)
Sends a request to be executed sychronously on this channel. The code is packaged into a class derived from the 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.

Specified by:
send in interface IChannel
Since:
RFT1.0
See Also:
ChannelRunnable

waitForResponse

protected boolean waitForResponse(ChannelRunnable request)

post

public void post(ChannelRunnable runnable)
Sends a request to be executed asychronously on this channel. (Not currently supported.)

Since:
RFT1.0

isCurrentChannel

public boolean isCurrentChannel()
Determines whether this channel is the current channel.

Specified by:
isCurrentChannel in interface IChannel
Returns:
true when running on the current channel.
Since:
RFT1.0

open

public void open()
Opens the channel. This method is called from the native code to initiate processing of a channel request.

Since:
RFT1.0

isUnresponsive

public boolean isUnresponsive()

setUnresponsive

public void setUnresponsive(boolean unresponsive)
Description copied from interface: IChannel
Mark the channel as unresponsive, usually after a message times out.

Specified by:
setUnresponsive in interface IChannel

isAlive

public boolean isAlive()
Description copied from interface: IChannel
Is the channel still alive? That is, is the thread and underlying SpyPort still active?

Specified by:
isAlive in interface IChannel
Returns:
true channel still alive