com.ibm.cics.server
Class Task

java.lang.Object
  |
  +--com.ibm.cics.server.API
        |
        +--com.ibm.cics.server.Task

public class Task
extends API
implements RetrieveBits

This class provides a set of methods and variables that correspond to a CICS task.


Field Summary
 java.io.PrintWriter err
           
static byte FCI_START_NO_DATA
           
static byte FCI_START_WITH_DATA
           
static byte FCI_TASK_WITH_FACILITY
           
static byte FCI_TRIGGERED_NO_FACILITY
           
 java.io.PrintWriter out
           
 
Method Summary
 void abend(java.lang.String abcode)
          Request a normal ABEND of the task.
 void commit()
          This method commits the currently active Unit Of Work.
 void disableTaskTrace()
          Not Implemented.  
 void enableTaskTrace()
          Not Implemented.  
 void forceAbend(java.lang.String abcode)
          Not Implemented.  
 byte getFCI()
          Return the FCI for the task.
 java.lang.Object getPrincipalFacility()
          Return the principal facility for the task.
 java.lang.String getQNAME()
          Return the QNAME for the task.
 java.lang.String getSTARTCODE()
          Return the STARTCODE for the task.
static Task getTask()
          Return the task object representing the task as part of which the current thread is executing.
 int getTaskNumber()
          Return the task number.
 java.lang.String getTransactionName()
          Return the transaction name.
 void getTWA(TWAHolder holder)
          Obtain a copy of the Task Work Area (TWA).
 java.lang.String getUSERID()
          Return the USERID that is signed on to the task's principal facility.
 void retrieve(java.util.BitSet whatToRetrieve, RetrievedDataHolder holder)
          Retrieve any data specified when this task was started.
 void rollback()
          This method rolls back the currently active Unit Of Work.
 void setTWA(byte[] data)
          Update the contents of the TWA from an array of bytes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

public java.io.PrintWriter out

err

public java.io.PrintWriter err

FCI_START_NO_DATA

public static final byte FCI_START_NO_DATA

FCI_START_WITH_DATA

public static final byte FCI_START_WITH_DATA

FCI_TASK_WITH_FACILITY

public static final byte FCI_TASK_WITH_FACILITY

FCI_TRIGGERED_NO_FACILITY

public static final byte FCI_TRIGGERED_NO_FACILITY
Method Detail

abend

public void abend(java.lang.String abcode)
Request a normal ABEND of the task. This is the equivalent of an EXEC CICS ABEND command.
Parameters:
abcode - The ABEND code.

commit

public void commit()
            throws InvalidRequestException,
                   RolledBackException
This method commits the currently active Unit Of Work.
Throws:
RolledBackException - a ROLLEDBACK condition occurred.
InvalidRequestException - an INVREQ condition occurred.

disableTaskTrace

public void disableTaskTrace()
This method is not implemented in this release.
 
Switch off task trace flag.

enableTaskTrace

public void enableTaskTrace()
This method is not implemented in this release.
 
Switch on task trace flag.

forceAbend

public void forceAbend(java.lang.String abcode)
This method is not implemented in this release.
 
Force the task to ABEND. This is the equivalent of an EXEC CICS ABEND CANCEL command.
Parameters:
abcode - The ABEND code.

getFCI

public byte getFCI()
Return the FCI for the task.
Returns:
the FCI value that corresponds to the way the Task was initiated. Possible values are:
  • X'00' - Start without data
  • X'01' - Terminal or APPC task
  • X'08' - Triggered task
  • X'10' - Start with data

getPrincipalFacility

public java.lang.Object getPrincipalFacility()
Return the principal facility for the task. This can be a TerminalPrincipalFacility, a ConversationPrincipalFacility, or NULL. Note that it is a simple object reference which is returned. To decide if the principal facility is a terminal or a conversation, it is necessary to use the instanceof operator to test if the object reference returned is an instance of a Terminal or of a Conversation.
Returns:
The principal facility.

getQNAME

public java.lang.String getQNAME()
Return the QNAME for the task.
Returns:
a String containing the QNAME.

getSTARTCODE

public java.lang.String getSTARTCODE()
Return the STARTCODE for the task.
Returns:
A two byte String containing the STARTCODE. Possible values are:
  • D - Distributed program link. Cannot issue syncpoint requests.
  • DS - Distributed program link. Can issue syncpoint requests.
  • QD - Transaction started by transient data trigger level.
  • S - Transaction started by START command (no data).
  • SD - Transaction started by START command (with data).
  • TD - Transaction started by terminal input.

getTask

public static Task getTask()
Return the task object representing the task as part of which the current thread is executing.
Returns:
the singleton Task object.

getTaskNumber

public int getTaskNumber()
Return the task number.
Returns:
an int containing the task number.

getTransactionName

public java.lang.String getTransactionName()
Return the transaction name.
Returns:
The Name of the transaction. This will be 4 characters in length.

getTWA

public void getTWA(TWAHolder holder)
Obtain a copy of the Task Work Area (TWA).
Parameters:
holder - A holder for the TWA. If there is no TWA, a byte array of length 0 is placed in the holder.

setTWA

public void setTWA(byte[] data)
            throws InvalidRequestException
Update the contents of the TWA from an array of bytes. This method must be called before returning from the task or invoking another program, as the Java TWA is a copy of the real TWA and any changes made in Java code must be reflected back into the real TWA before another program is invoked which would not see the current program's copy of the TWA.
Parameters:
data - the new data to be copied into the TWA.
Throws:
InvalidRequestException - the task does not have a TWA.

getUSERID

public java.lang.String getUSERID()
                           throws InvalidRequestException
Return the USERID that is signed on to the task's principal facility.
Returns:
a String containing the USERID.
Throws:
InvalidRequestException - an INVREQ condition occurs if the task is not initiated from a terminal.

retrieve

public void retrieve(java.util.BitSet whatToRetrieve,
                     RetrievedDataHolder holder)
              throws EndOfDataException,
                     InvalidRequestException,
                     InvalidRetrieveOptionException,
                     IOErrorException,
                     LengthErrorException,
                     RecordNotFoundException
Retrieve any data specified when this task was started.
Parameters:
whatToRetrieve - the RetrieveBits interface provides a set of constants that should be used to construct this java.util.BitSet.
holder - for the RetrievedData.
Throws:
EndOfDataException - a ENDDATA condition occurred.
InvalidRequestException - an INVREQ condition occurred.
InvalidRetrieveOptionException - a ENVDEFERR condition occurred.
IOErrorException - an IOERR condition occurred.
LengthErrorException - a LENGERR condition occurred.
RecordNotFoundException - a NOTFND condition occurred.

rollback

public void rollback()
              throws InvalidRequestException
This method rolls back the currently active Unit Of Work.
Throws:
InvalidRequestException - The program issuing the commit request is a remotely-linked-to program and SYNCONRETURN was not specified.


Copyright (c) 2002 by Sun Microsystems, Inc.