IBM Rational Performance Tester SDK

com.ibm.rational.test.lt.kernel.io
Interface IKChannel

All Superinterfaces:
ICountable, IKAction, IKLog, IKSemaphore, ITestExecutionServices, Runnable

public interface IKChannel
extends IKAction


Field Summary
static int KC_CANCELTIMEOUT
           
static int KC_CONNECTED
           
static int KC_CONNECTFAIL
           
static int KC_DELAY
           
static int KC_FINISHCONNECT
           
static int KC_FINISHHANDSHAKE
           
static int KC_FINISHREAD
           
static int KC_HANDSHAKE_COMPLETE
           
static int KC_HANDSHAKE_REQUESTREAD
           
static int KC_READCOMPLETED
           
static int KC_READFAIL
           
static int KC_READING
           
static int KC_REQUESTCONNECT
           
static int KC_REQUESTREAD
           
static int KC_UNCONNECTED
           
static int KC_WRITING
           
static String[] KCStatus
           
 
Fields inherited from interface com.ibm.rational.test.lt.kernel.action.IKAction
ABANDONED, DP_ENCRYPTED_VALUES_KEY, EXECUTING, FINISHED, HANDLETIMER, SEMWAIT, SLEEPING, Status, UNSTARTED
 
Fields inherited from interface com.ibm.rational.test.lt.kernel.logging.IKLog
HISTORY_ALL, HISTORY_NONE, HISTORY_PAGES, HISTORY_REQUESTS, HISTORY_SCHEDULE, LOG_ALL, LOG_CONFIG, LOG_FINE, LOG_FINER, LOG_FINEST, LOG_INFO, LOG_NONE, LOG_SEVERE, LOG_WARNING, STATISTIC_ALL, STATISTIC_NONE, STATISTIC_PAGES
 
Fields inherited from interface com.ibm.rational.test.lt.kernel.services.ITestExecutionServices
STORAGE_LOCAL, STORAGE_USER
 
Method Summary
 void connect(InetSocketAddress address)
           
 void connect(InetSocketAddress localAddress, InetSocketAddress remoteAddress)
           
 IKernelChannel getChannel()
           
 int getState()
           
 void handleConnect(Throwable throwable)
           
 void handleHandshakeComplete(Throwable throwable)
          Called by the Kernel after SSL handshake has completed.
 long handleRead(ByteBuffer buffer, long byteCount, Throwable throwable)
          Called by the Kernel after a channel has data available.
 void read()
           
 void readHandshake()
          Handshake read has distinct states from regular read.
 void registerConnect(Selector s)
           
 void registerRead(Selector s)
           
 void retry()
          Attempt to try this entire I/O action over again.
 void retry(boolean closeConnection)
          Attempt to try this entire I/O action over again.
 void setChannel(IKernelChannel channel)
          Instruct this channel to reuse an existing channel.
 void setState(int state)
           
 
Methods inherited from interface com.ibm.rational.test.lt.kernel.action.IKAction
abandon, addEventBehavior, blocked, execute, executeAction, executionTime, findDataArea, finish, getBlockedTimeout, getHistory, getHistoryType, getId, getName, getParent, getResultInteger, getResultObject, getResultString, getRtbEnabled, getStatTree, getStopRequested, getSubsystem, getTimeoutDuration, getTimeoutScheme, getVirtualUserName, getWorkerThread, hasFinished, hasStarted, isRunning, reset, setBlockedTimeout, setDispatchingAction, setHistory, setHistoryType, setId, setResultInteger, setResultObject, setResultString, setResultString, setRtbEnabled, setStatTree, start, status, stop, stop, stopAction
 
Methods inherited from interface com.ibm.rational.test.lt.kernel.ICountable
addCounter, getCounter, getCounters, resetCounters
 
Methods inherited from interface com.ibm.rational.test.lt.kernel.logging.IKLog
getHistoryLevel, getHistoryLevel, getLogLevel, getStatisticsLevel, getVirtualUserGUID, log, log, log, log, reportEvent, reportEvent, reportEvent, reportMessage, reportMessage, reportMessage, reportVerdict, reportVerdict, reportVerdict, reportVerdict, reportVerificationPoint, reportVerificationPoint, reportVerificationPoint, reportVerificationPoint, reportVerificationPoint, reportVerificationPoint, wouldARM, wouldLog, wouldReportHistory, wouldReportHistory, wouldReportStatistics
 
Methods inherited from interface com.ibm.rational.test.lt.kernel.action.IKSemaphore
acquire, availablePermits, getQueue, getQueueLength, reducePermits, release, release, toString, tryAcquire, tryAcquire
 
Methods inherited from interface com.ibm.rational.test.lt.kernel.services.ITestExecutionServices
getARM, getLoopControl, getPDLogManager, getStatisticsManager, getTestLogManager, getTime, getTransaction, getValue, setValue
 
Methods inherited from interface java.lang.Runnable
run
 

Field Detail

KC_UNCONNECTED

static final int KC_UNCONNECTED
See Also:
Constant Field Values

KC_REQUESTCONNECT

static final int KC_REQUESTCONNECT
See Also:
Constant Field Values

KC_FINISHCONNECT

static final int KC_FINISHCONNECT
See Also:
Constant Field Values

KC_CONNECTED

static final int KC_CONNECTED
See Also:
Constant Field Values

KC_CONNECTFAIL

static final int KC_CONNECTFAIL
See Also:
Constant Field Values

KC_WRITING

static final int KC_WRITING
See Also:
Constant Field Values

KC_REQUESTREAD

static final int KC_REQUESTREAD
See Also:
Constant Field Values

KC_FINISHREAD

static final int KC_FINISHREAD
See Also:
Constant Field Values

KC_READING

static final int KC_READING
See Also:
Constant Field Values

KC_READCOMPLETED

static final int KC_READCOMPLETED
See Also:
Constant Field Values

KC_READFAIL

static final int KC_READFAIL
See Also:
Constant Field Values

KC_CANCELTIMEOUT

static final int KC_CANCELTIMEOUT
See Also:
Constant Field Values

KC_DELAY

static final int KC_DELAY
See Also:
Constant Field Values

KC_HANDSHAKE_REQUESTREAD

static final int KC_HANDSHAKE_REQUESTREAD
See Also:
Constant Field Values

KC_FINISHHANDSHAKE

static final int KC_FINISHHANDSHAKE
See Also:
Constant Field Values

KC_HANDSHAKE_COMPLETE

static final int KC_HANDSHAKE_COMPLETE
See Also:
Constant Field Values

KCStatus

static final String[] KCStatus
Method Detail

retry

void retry()
Attempt to try this entire I/O action over again.

retry() closes the connection (if open), resets internal structures, cancels any waiting timeouts, and redispatchs the action for execution. This will result in the execute() method being called again.

Note: finish() should not be called after this method is called. Your method should just return.

See Also:
IKChannel.retry(boolean)

retry

void retry(boolean closeConnection)
Attempt to try this entire I/O action over again.

This version of retry will optionally close the connection (if the closeConnection boolean is true), reset internal structures, cancel any waiting timeouts, and redispatch the action for execution. This will result in the execute() method being called again.

Note: finish() should not be called after this method is called. Your method should just return.

Parameters:
closeConnection - reset the connection if true

connect

void connect(InetSocketAddress address)
             throws Exception
Throws:
Exception

connect

void connect(InetSocketAddress localAddress,
             InetSocketAddress remoteAddress)
             throws Exception
Throws:
Exception

handleConnect

void handleConnect(Throwable throwable)

read

void read()

handleRead

long handleRead(ByteBuffer buffer,
                long byteCount,
                Throwable throwable)
Called by the Kernel after a channel has data available.

Parameters:
buffer - bytes of data read from channel
byteCount - number of bytes placed into 'buffer'
throwable -
Returns:
zero (0) if that action should keep reading; or -1 if the read is complete (as determined by the action).

readHandshake

void readHandshake()
Handshake read has distinct states from regular read.


handleHandshakeComplete

void handleHandshakeComplete(Throwable throwable)
Called by the Kernel after SSL handshake has completed.


setChannel

void setChannel(IKernelChannel channel)
Instruct this channel to reuse an existing channel.

This method can be used to insure that one I/O operation uses the same connection to a back-end server that some previous operation used.

Examples of where this may be more important or efficient: SSL, NTLM, DigiCerts, Keep-Alive, telnet, etc.

If this connectivity (between I/O operations) is unnecessary (as in the case of more general web testing or load generation, it will likely be more efficient to allow the kernel to pool its resources and choose for itself which connection to use.

In general, if using this operational characteristic, make sure you understand the implications of reusing these channels. Also, it would be good practice to daisy-chain references to these actions as opposed to having all subsequent actions reuse one initial action.

Notes:

Parameters:
channel - the kernel channel to reuse

getChannel

IKernelChannel getChannel()

registerConnect

void registerConnect(Selector s)
                     throws ClosedChannelException,
                            com.ibm.rational.test.lt.kernel.io.KMonitoredChannelException
Throws:
ClosedChannelException
com.ibm.rational.test.lt.kernel.io.KMonitoredChannelException

registerRead

void registerRead(Selector s)
                  throws ClosedChannelException,
                         com.ibm.rational.test.lt.kernel.io.KMonitoredChannelException
Throws:
ClosedChannelException
com.ibm.rational.test.lt.kernel.io.KMonitoredChannelException

getState

int getState()

setState

void setState(int state)

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.