com.sun.emp.cci.eci
Class ECIInteraction

java.lang.Object
  |
  +--com.sun.emp.cci.eci.ECIInteraction
All Implemented Interfaces:
Interaction

public class ECIInteraction
extends Object
implements Interaction

An object allowing execution of MTP programs.

The actual program execution is governed by the interaction specifications and the record supplied to this class.


Constructor Summary
ECIInteraction(ECIConnection connection)
          Establish an interaction over a connection.
 
Method Summary
 void clearWarnings()
          Clear the warnings for this object.
 void close()
          Close the interaction.
 Record execute(InteractionSpec iSpec, Record input)
          Execute an MTP program.
 boolean execute(InteractionSpec iSpec, Record input, Record output)
          Execute an MTP program.
 Connection getConnection()
          Get the connection for this interaction.
 ResourceWarning getWarnings()
          Get the warnings associated this this interaction.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ECIInteraction

public ECIInteraction(ECIConnection connection)
Establish an interaction over a connection.

Parameters:
connection - The connection
Throws:
NullPointerException - if the connection is null.
Method Detail

close

public void close()
           throws ResourceException
Close the interaction.

Specified by:
close in interface Interaction
ResourceException

getConnection

public Connection getConnection()
Get the connection for this interaction.

Specified by:
getConnection in interface Interaction
Returns:
The connection

execute

public boolean execute(InteractionSpec iSpec,
                       Record input,
                       Record output)
                throws ResourceException
Execute an MTP program.

The program execution is governed by the parameters to this method. The input record data is passed to the executing program, and the output record is populated with any returned data.

Specified by:
execute in interface Interaction
Parameters:
iSpec - The interaction specifiaction ( must be an instance of ECIInteractionSpec )
input - The input record. (Must be an instance of Streamable)
output - The output record. (Must be an instance of Streamable)
Throws:
NullPointerException - if any of the paramteres is null.
ECITransactionAbendException - if the transaction abends.
ResourceException - if the parameters are not of the correct type.
ResourceException - if the input record has more that 32500 bytes in it.
ResourceException - if any RMI or IO exception occurs whilst processing the request.
IllegalStateException - if the interaction has been closed.
See Also:
ECIInteractionSpec, Streamable

execute

public Record execute(InteractionSpec iSpec,
                      Record input)
               throws ResourceException
Execute an MTP program.

The program execution is governed by the parameter to this method. The input record data is passed to the executing program, and the output of the program is used to construct the returned output record.

Specified by:
execute in interface Interaction
Parameters:
iSpec - The interaction specifiaction ( must be an instance of ECIInteractionSpec )
input - The input record. (Must be an instance of Streamable)
Returns:
a record containing the returned data. This will be an instance of the GenericRecord class.
Throws:
NullPointerException - if any of the paramteres is null.
ECITransactionAbendException - if the transaction abends.
ResourceException - if the parameters are not of the correct type.
ResourceException - if the input record has more that 32500 bytes in it.
ResourceException - if any RMI or IO exception occurs whilst processing the request.
IllegalStateException - if the interaction has been closed.
See Also:
ECIInteractionSpec, GenericRecord, Streamable

getWarnings

public ResourceWarning getWarnings()
                            throws ResourceException
Get the warnings associated this this interaction.

There are never any warnings associated with this class.

Specified by:
getWarnings in interface Interaction
Returns:
null
ResourceException

clearWarnings

public void clearWarnings()
                   throws ResourceException
Clear the warnings for this object.

Since there are never any warnings, this operation does nothing.

Specified by:
clearWarnings in interface Interaction
ResourceException