CICS® Transaction Gateway Programming Reference v1.1.0.0

com.ibm.ctg.epi
Class TerminalEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.ibm.ctg.epi.TerminalEvent
All Implemented Interfaces:
java.io.Serializable

public class TerminalEvent
extends java.util.EventObject

This event is raised by the EPITerminal bean when the terminal connects or disconnects, when a new screen is received from the server, or when an exception occurs. It is also used to request screen handlers to take specific actions, such as exiting the current transaction to allow the terminal to disconnect.

A screen handler that receives this event can set the event 'handled' to notify other screen handlers that the event is being processed. Screen handlers should check whether the event is being handled before attempting to drive the terminal, set fields on the screen etc.

See Also:
Serialized Form

Field Summary
static int EXIT_SCREEN_REQUEST
          The terminal requests the screen handler to exit this screen.
static int NO_REQUEST
          No terminal request.
 
Constructor Summary
TerminalEvent(java.lang.Object s, TerminalSession t)
          Construct a terminal event.
TerminalEvent(java.lang.Object s, TerminalSession t, java.lang.Exception e)
          Construct a terminal exception event.
TerminalEvent(java.lang.Object s, TerminalSession t, int id)
          Construct a terminal event.
 
Method Summary
 java.lang.Exception getException()
          Returns the exception associated with this event.
 TerminalSession getTerminal()
          Returns the terminal associated with this event.
 int getTerminalRequest()
          Returns the terminal request ID.
 boolean isHandled()
          Returns true if the event is already being handled by another listener.
 void setHandled()
          Set the event to be handled.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EXIT_SCREEN_REQUEST

public static final int EXIT_SCREEN_REQUEST
The terminal requests the screen handler to exit this screen.

See Also:
Constant Field Values

NO_REQUEST

public static final int NO_REQUEST
No terminal request.

See Also:
Constant Field Values
Constructor Detail

TerminalEvent

public TerminalEvent(java.lang.Object s,
                     TerminalSession t)
Construct a terminal event.

Parameters:
s - the source of the event
t - the terminal

TerminalEvent

public TerminalEvent(java.lang.Object s,
                     TerminalSession t,
                     int id)
Construct a terminal event.

Parameters:
s - the source of the event
t - the terminal
id - the terminal request identifier

TerminalEvent

public TerminalEvent(java.lang.Object s,
                     TerminalSession t,
                     java.lang.Exception e)
Construct a terminal exception event.

Parameters:
s - the source of the event
t - the terminal
e - the exception
Method Detail

getTerminal

public TerminalSession getTerminal()
Returns the terminal associated with this event.

Returns:
the terminal (EPITerminal bean)

setHandled

public void setHandled()
Set the event to be handled. This is done to notify other listeners that they should not attempt to drive the terminal or access the screen. Listeners should check whether the event is being handled so that they don't get in each others way.


isHandled

public boolean isHandled()
Returns true if the event is already being handled by another listener.

Returns:
true or false

getException

public java.lang.Exception getException()
Returns the exception associated with this event. This is only set for the exceptionOccurred event.

Returns:
the exception if there is one

getTerminalRequest

public int getTerminalRequest()
Returns the terminal request ID. This is used to allow the terminal to request screen handlers to perform a specific action, for example exiting the screen. It is only set for the handleScreen event.

Returns:
the request ID

©Copyright IBM Corp. 1994, 2014
Legal