public class ChannelSwitchException
extends com.rational.test.ft.RationalTestException
ChannelSwitchException
is thrown when code needs to
be executed on the thread of the original channel request rather than the
channel associated with the current thread. The desired code is packaged into a
class that extends ChannelRunnable
and implements send
.Constructor and Description |
---|
ChannelSwitchException(ChannelRunnable request)
Creates exception with the
ChannelRunnable object. |
ChannelSwitchException(ChannelRunnable request,
IChannel channel)
Creates a
ChannelSwitchException that should be executed on a thread associated
with a specific channel. |
Modifier and Type | Method and Description |
---|---|
IChannel |
getChannel()
Gets the
IChannel associated with this ChannelSwitchException . |
ChannelRunnable |
getRequest()
Gets the
ChannelRunnable object associated with this
ChannelSwitchException . |
java.lang.Object |
run()
Executes the
ChannelRunnable object, called when the channel returns control to
the originating thread. |
public ChannelSwitchException(ChannelRunnable request)
ChannelRunnable
object. The object
is executed on the thread that invoked the original channel request.request
- The code to be executed on the original thread packaged into
a ChannelRunnable
object.public ChannelSwitchException(ChannelRunnable request, IChannel channel)
ChannelSwitchException
that should be executed on a thread associated
with a specific channel.request
- The code to be executed on the thread associated with
channel packaged into a ChannelRunnable
object.channel
- The thread where the ChannelRunnable
object should be
run. If null
, then the code runs on the thread that originated the
channel request.public java.lang.Object run()
ChannelRunnable
object, called when the channel returns control to
the originating thread.public ChannelRunnable getRequest()
ChannelRunnable
object associated with this
ChannelSwitchException
.public IChannel getChannel()
IChannel
associated with this ChannelSwitchException
.