com.mockrunner.connector
Interface InteractionImplementor

All Known Implementing Classes:
GenericFailureInteraction, IndexedRecordInteraction, MappedRecordInteraction, StreamableRecordByteArrayInteraction, WSIFInteraction

public interface InteractionImplementor

Implementations of this interface can be addded to InteractionHandler. When one of the two execute methods of MockInteraction are called, the InteractionHandler iterates through the implementors and dispatches the execute call to the first one which returns true for canHandle(javax.resource.cci.InteractionSpec, javax.resource.cci.Record, javax.resource.cci.Record). There are several implementations of this interface, e.g. StreamableRecordByteArrayInteraction, WSIFInteraction, IndexedRecordInteraction, MappedRecordInteraction. Of course, you can also implement your own version and it may be necessary in many situations.


Method Summary
 boolean canHandle(javax.resource.cci.InteractionSpec interactionSpec, javax.resource.cci.Record actualRequest, javax.resource.cci.Record actualResponse)
          Implementors should return true if this implementor can handle the request.
 javax.resource.cci.Record execute(javax.resource.cci.InteractionSpec interactionSpec, javax.resource.cci.Record actualRequest)
          First version of the Interaction.execute methods.
 boolean execute(javax.resource.cci.InteractionSpec interactionSpec, javax.resource.cci.Record actualRequest, javax.resource.cci.Record actualResponse)
          Second version of the Interaction.execute methods.
 

Method Detail

canHandle

boolean canHandle(javax.resource.cci.InteractionSpec interactionSpec,
                  javax.resource.cci.Record actualRequest,
                  javax.resource.cci.Record actualResponse)
Implementors should return true if this implementor can handle the request. Please note that for calls to execute(InteractionSpec, Record), the second Record parameter is null.

Parameters:
interactionSpec - the InteractionSpec for the actual call
actualRequest - the request for the actual call
actualResponse - the response for the actual call, may be null
Returns:
true if this implementor will handle the request and will return the specified response, false otherwise

execute

javax.resource.cci.Record execute(javax.resource.cci.InteractionSpec interactionSpec,
                                  javax.resource.cci.Record actualRequest)
                                  throws javax.resource.ResourceException
First version of the Interaction.execute methods.

Parameters:
interactionSpec - the interaction spec
actualRequest - the actual request
Returns:
the response according to the current request
Throws:
javax.resource.ResourceException

execute

boolean execute(javax.resource.cci.InteractionSpec interactionSpec,
                javax.resource.cci.Record actualRequest,
                javax.resource.cci.Record actualResponse)
                throws javax.resource.ResourceException
Second version of the Interaction.execute methods.

Parameters:
interactionSpec - the interaction spec
actualRequest - the actual request
actualResponse - the actual response
Returns:
true under normal conditions
Throws:
javax.resource.ResourceException