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 ChannelRunnable

java.lang.Object   extended by com.rational.test.ft.domain.ChannelRunnable
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
ShellFinder

public abstract class ChannelRunnable
extends java.lang.Object
implements java.lang.Runnable

An abstract implementation of a runnable interface that can be scheduled for execution on a specific channel. The implementor defines a class that extends this one, overriding send().

Since:
RFT1.0
See Also:
IChannel, ThreadChannel, ChannelSwitchException

Field Summary
protected  boolean complete
           
protected  java.lang.Object returnValue
           
protected  java.lang.Throwable throwable
           
 
Constructor Summary
ChannelRunnable()
           
ChannelRunnable(long timeout)
           
 
Method Summary
 java.lang.Object getReturnValue()
          Gets the return value from send().
 boolean isComplete()
          Did the channel operation complete?
 boolean isRevoked()
           
 boolean isStarted()
          has the runnable actually started to execute on the destination channel.
 void run()
          Called by the underlying IChannel implementation to run the ChannelRunnable object.
abstract  java.lang.Object send()
          Implementors override this method with code that must be run on this channel.
 void setComplete(boolean done)
          Set the completion status of the channel operation.
 void setCrossChannel()
           
 ChannelRunnable setTimeout(int milliseconds)
          Set the time when this message will expire.
 void throwException()
          Throws any pending throwable that occurs while executing on the channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

returnValue

protected java.lang.Object returnValue

complete

protected boolean complete

throwable

protected java.lang.Throwable throwable
Constructor Detail

ChannelRunnable

public ChannelRunnable()

ChannelRunnable

public ChannelRunnable(long timeout)
Method Detail

send

public abstract java.lang.Object send()
Implementors override this method with code that must be run on this channel.

Returns:
The runnable object. This return value is available by invoking getReturnValue().
Since:
RFT1.0

setCrossChannel

public void setCrossChannel()

setTimeout

public ChannelRunnable setTimeout(int milliseconds)
Set the time when this message will expire. The sender will give up if the processing of this message is not begun before this time is up.


isRevoked

public boolean isRevoked()

run

public void run()
Called by the underlying IChannel implementation to run the ChannelRunnable object. Invokes send() and saves the return value.

Specified by:
run in interface java.lang.Runnable
Since:
RFT1.0

throwException

public void throwException()
Throws any pending throwable that occurs while executing on the channel. If the send() implementation has code that must run on the original thread, this method catches the ChannelSwitchException and invokes run().

Since:
RFT1.0

getReturnValue

public java.lang.Object getReturnValue()
Gets the return value from send(). This return value is marshalled back to the originating thread that invoked the channel request.

Since:
RFT1.0

isComplete

public boolean isComplete()
Did the channel operation complete?

Returns:
true if channel send completed.
Since:
RFT 1.1

setComplete

public void setComplete(boolean done)
Set the completion status of the channel operation.

Parameters:
done - - true if send completed, false otherwise.
Since:
RFT 1.1

isStarted

public boolean isStarted()
has the runnable actually started to execute on the destination channel.

Returns:
true if started.