/* Copyright (c) 2002, Oracle Corporation. All Rights Reserved. */ 
package oracle.portal.sample.portalTools.devguide.jcasample;

import java.util.List;
import java.util.ArrayList;

import javax.resource.cci.InteractionSpec;

/**
 * This class implements the JCA <code>InteractionSpec</code> interface.
 *
 * It stores all interaction properties required to call an interaction.  
 * This SampleInteractionSpec supports following properties,
 * <pre>
 *  - methodName: Name of the method the interaction will call.
 *  - maxRow: Maxium number of output rows. 
 * </pre>
 *
 * In the provider definition, this should be defined as follows:
 * <pre>
 * &ltinteractionHandler class="oracle.webdb.reformlet.data.jca.InteractionHandler">
 *   &ltinteractionSpec class="oracle.portal.sample.portalTools.devguide.jcasample.SampleInteractionSpec">
 *      &ltmethodName>...&lt/methodName>
 *      &ltmaxRow>...&lt/maxRow>
 *   &lt/interactionSpec> 
 * &lt/interactionHandler>
 * </pre>
 *
 * If there is no interaction property to define, the interactionSpec tag may not
 * be defined in the definition.
 *
 * Note that the class must be implemented as a Bean. It must have setMethodName 
 * and getMethodName methods for the "methodName" tag it supports.
 */
public class SampleInteractionSpec implements InteractionSpec
{
  private String mMethodName = null;
  private int mMaxRow = 5;

  ///////////////////////////////
  // Provide methods for the property "methodName"
  ///////////////////////////////

  /**
   * Set the data for the tag "methodName".
   * @param val The value to set for the tag.
   */
  public void setMethodName(String val)
  {
    mMethodName = val;
  }

  /**
   * Get the data for the tag "methodName".
   * @return The value of the tag.
   */
  public String getMethodName()
  {
    return mMethodName;
  }

  ///////////////////////////////
  // Provide methods for the property "maxRow"
  ///////////////////////////////

  /**
   * Set the data for the tag "maxRow".
   * @param val The value to set for the tag.
   */
  public void setMaxRow(String val)
  {
    mMaxRow = Integer.parseInt(val);
  }

  /**
   * Get the data for the tag "maxRow".
   * @return The value of the tag.
   */
  public int getMaxRow()
  {
    return mMaxRow;
  }


}
