com.infoengine.connector
Class IeInteraction

java.lang.Object
  extended bycom.infoengine.connector.IeInteraction
All Implemented Interfaces:
javax.resource.cci.Interaction

public class IeInteraction
extends Object
implements javax.resource.cci.Interaction

CCI Interaction object. Applications use this object to invoke methods/functions on the underlying EIS (Info*Engine/Windchill).

Example:

Connection cx = myFactory.getConnection();
Interaction ix = cx.createInteraction();
// create interactionspec
IeInteractionSpec ixSpec = new IeInteractionSpec();
try {
  ixSpec.setFunctionName ( "myMethodName" );
  ixSpec.setClassName ( "com.myCompany.myClass" );
} catch ( Exception ex ) {
  ex.printStackTrace ( System.err );
}

// create input record (parameters to pass)
RecordFactory rf = myFactory.getRecordFactory();
MappedRecord input = rf.createMappedRecord ( "input" );
input.put ( "parmName", "parmValue" );

// invoke the business method myMethodName on SOAP class com.myCompany.myClass IeInteractionResult result = (IeInteractionResult)ix.execute ( ixSpec, input );

// object returned here is goverened by the Info*Engine task
// may be java object, java object representation of primitive,
// a java bean or a Group
Object o = result.getResult();

See Also:
IeInteractionSpec, IeInteractionResult

Nested Class Summary
private  class IeInteraction.Deserializer
          PrivilegedAction class used for SOAP deserialization.
private  class IeInteraction.GetBody
           
private  class IeInteraction.Serializer
          PrivilegedAction class used for SOAP deserialization.
 
Field Summary
private  IeConnection cx
           
private  Method DESERIALIZE_METHOD
           
private  Log log
           
private  Method SERIALIZE_METHOD
           
 
Constructor Summary
(package private) IeInteraction(IeConnection c, Log l)
          create a new IeInteraction associated with connection handle c
 
Method Summary
private  void attach(javax.xml.soap.SOAPMessage msg, String name, javax.activation.DataSource data)
           
 void clearWarnings()
          remove any connection warnings.
 void close()
          close this interaction.
private  javax.xml.soap.SOAPMessage digitallySign(javax.xml.soap.SOAPMessage message)
           
 javax.resource.cci.Record execute(javax.resource.cci.InteractionSpec isSpec, javax.resource.cci.Record input)
          execute a method
 boolean execute(javax.resource.cci.InteractionSpec isSpec, javax.resource.cci.Record input, javax.resource.cci.Record output)
          always throws NowSupportedException.
private  void getBeanParams(javax.resource.cci.Record input, Vector v)
          idea is to support input records other than MappedRecord and IndexedRecord that are beans.
 javax.resource.cci.Connection getConnection()
          get the connection handle this interaction is associated with
private  Hashtable getParams(javax.resource.cci.Record input)
          get the parameters from the input record.
 javax.resource.cci.ResourceWarning getWarnings()
          get ResourceWarning.
(package private)  void setDeserializeMethod(Method m)
          Hook added to allow DCA to deserialize straight to I*E data structures for performance improvements.
(package private)  void setSerializeMethod(Method m)
          Hook added to allow DCA to serialize straight from I*E data structures for performance improvements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cx

private IeConnection cx

log

private Log log

SERIALIZE_METHOD

private Method SERIALIZE_METHOD

DESERIALIZE_METHOD

private Method DESERIALIZE_METHOD
Constructor Detail

IeInteraction

IeInteraction(IeConnection c,
              Log l)
create a new IeInteraction associated with connection handle c

Parameters:
c - connection handle
l - Log
Method Detail

setSerializeMethod

void setSerializeMethod(Method m)
Hook added to allow DCA to serialize straight from I*E data structures for performance improvements.

package access so that DataAccessObject can manipulate.

Parameters:
m - The serialize method method must be static and accept the following args (String,Object,SOAPElement,SOAPMessage)

setDeserializeMethod

void setDeserializeMethod(Method m)
Hook added to allow DCA to deserialize straight to I*E data structures for performance improvements.

package access so that DataAccessObject can manipulate.

Parameters:
m - The deserialize method method must be static and accept SOAPMessage as single param

clearWarnings

public void clearWarnings()
                   throws javax.resource.ResourceException
remove any connection warnings. currently a no-op.

Specified by:
clearWarnings in interface javax.resource.cci.Interaction
Throws:
javax.resource.ResourceException

close

public void close()
           throws javax.resource.ResourceException
close this interaction. currently a no-op.

Specified by:
close in interface javax.resource.cci.Interaction
Throws:
javax.resource.ResourceException

execute

public javax.resource.cci.Record execute(javax.resource.cci.InteractionSpec isSpec,
                                         javax.resource.cci.Record input)
                                  throws javax.resource.ResourceException
execute a method

Specified by:
execute in interface javax.resource.cci.Interaction
Parameters:
isSpec - interaction spec that contains method name and SOAP class
input - parameters to pass (may be null).
Returns:
Record more specifically an instance of IeInteractionResult
Throws:
javax.resource.ResourceException - if something bad happens...
See Also:
IeInteractionResult

attach

private void attach(javax.xml.soap.SOAPMessage msg,
                    String name,
                    javax.activation.DataSource data)
             throws Exception
Throws:
Exception

digitallySign

private javax.xml.soap.SOAPMessage digitallySign(javax.xml.soap.SOAPMessage message)
                                          throws Exception
Throws:
Exception

execute

public boolean execute(javax.resource.cci.InteractionSpec isSpec,
                       javax.resource.cci.Record input,
                       javax.resource.cci.Record output)
                throws javax.resource.ResourceException
always throws NowSupportedException. As stated in IeResourceAdapterMetaData execute with output record is not supported.

Specified by:
execute in interface javax.resource.cci.Interaction
Throws:
javax.resource.NotSupportedException
javax.resource.ResourceException

getConnection

public javax.resource.cci.Connection getConnection()
get the connection handle this interaction is associated with

Specified by:
getConnection in interface javax.resource.cci.Interaction
Returns:
Connection

getWarnings

public javax.resource.cci.ResourceWarning getWarnings()
                                               throws javax.resource.ResourceException
get ResourceWarning. currently warnings aren't stored, null is always returned.

Specified by:
getWarnings in interface javax.resource.cci.Interaction
Returns:
ResourceWarning
Throws:
javax.resource.ResourceException

getParams

private Hashtable getParams(javax.resource.cci.Record input)
get the parameters from the input record. input can be either a MappedRecord or an IndexedRecord. If mapped parameters are one per key. If indexed values must be strings and must be of the form =.

Parameters:
input - the input record

getBeanParams

private void getBeanParams(javax.resource.cci.Record input,
                           Vector v)
idea is to support input records other than MappedRecord and IndexedRecord that are beans. introspection could be used to map bean properties to parameters. currently does nothing.