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

Interface IKChannel

    • Field Detail

      • KC_UNCONNECTED

        static final int KC_UNCONNECTED
      • KC_REQUESTCONNECT

        static final int KC_REQUESTCONNECT
      • KC_FINISHCONNECT

        static final int KC_FINISHCONNECT
      • KC_CONNECTED

        static final int KC_CONNECTED
      • KC_CONNECTFAIL

        static final int KC_CONNECTFAIL
      • KC_WRITING

        static final int KC_WRITING
      • KC_REQUESTREAD

        static final int KC_REQUESTREAD
      • KC_FINISHREAD

        static final int KC_FINISHREAD
      • KC_READING

        static final int KC_READING
      • KC_READCOMPLETED

        static final int KC_READCOMPLETED
      • KC_READFAIL

        static final int KC_READFAIL
      • KC_CANCELTIMEOUT

        static final int KC_CANCELTIMEOUT
      • KC_DELAY

        static final int KC_DELAY
      • KC_HANDSHAKE_REQUESTREAD

        static final int KC_HANDSHAKE_REQUESTREAD
      • KC_FINISHHANDSHAKE

        static final int KC_FINISHHANDSHAKE
      • KC_HANDSHAKE_COMPLETE

        static final int KC_HANDSHAKE_COMPLETE
      • 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
      • 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:

        • If the specified channel is not valid for some reason, a new channel will be established by this action and passed to subseqent actions.
        • If the specified channel is valid and open, but of the wrong type (e.g., an SSL connection is needed, but a clear-text channel is specified), a new channel will be established.
        • If no channel is specified, the kernel will decide on its own how best to fulfill the request.
        • close() should be explicitly called by the script if the next action should re-establish a new connection.
        Parameters:
        channel - the kernel channel to reuse
      • getState

        int getState()
      • setState

        void setState(int state)
IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2013. All rights reserved.