com.ibm.cics.server
Class Wrapper

java.lang.Object
  extended by com.ibm.cics.server.Wrapper

public final class Wrapper
extends java.lang.Object

Class that wraps a user's main Java application, providing access to the COMMAREA, if one is supplied, and also catching all exceptions. Its name cannot be changed from com.ibm.cics.server.Wrapper because it is invoked as that by CICS JVM initialisation code. Logically it belongs in the com.ibm.cics.server.ts.ext package. Its callUserClass method is invoked by the Wrapper class main method. It invokes either main(CommAreaHolder) or main(String[]).

Since:
3.2

Field Summary
static java.io.PrintStream errHandler
          Create print stream for error
static java.io.PrintStream outHandler
          Create print stream for output
 
Constructor Summary
Wrapper()
           
 
Method Summary
static void addOrbRef(org.omg.CORBA.ORB theOrb)
           
static void callUserClass(java.lang.String[] args)
          This callUserClass method attempts to call the CommAreaHolder variant of main() on the user's class.
static boolean collectingTrace()
          Determine if trace should be passed to CICS, if it doesn't need to be then there is a significant saving in pathlength due to avoiding expensive RAS initialization.
static int isSQLJPropSet()
          Has SQLJ set its property ? (also called by DTCTask.c so don't remove!) If getProperty returns null, it has not been set and returns 0, else 1
static void jvmServerOSGiEntry(com.ibm.cics.osgi.ClassProxy classProxy)
          Entry point into the Wrapper for OSGi JVMSERVER threads.
static void jvmServerStats(java.lang.String[] args)
          Called by a CICS JVMServer system thread to collect statistics.
static void jvmServerTerminate(java.lang.String[] args)
          Entry method for DFHSJTH to stop threads during the purge/kill of a JVMServer
static void jvmServerWrapperEntry(java.lang.String[] args)
          Entry point into the Wrapper for JVMSERVER threads.
static void main(java.lang.String[] args)
          This main method has been split into smaller methods that can be called from WrapperEntry and jvmServerWrapperEntry, in order to prevent the duplication of code.
static void set_jvmserver_disabling(java.lang.String[] args)
          Sets the 'being_disabled' flag on this JVMSERVER This will prevent any threads crossing into CICS code, instead they return a 'purged' exception.
static long WrapperCCStats()
          Return the free space available in the Shared Class Cache
static int WrapperEntry(java.lang.String[] args)
          Entry point into the Wrapper from DFHSJCS.
static int WrapperGC()
          This method is invoked by the SJ domain to ensure that a full GC scan is done after the heap utilisation exceeds the threshhold
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outHandler

public static java.io.PrintStream outHandler
Create print stream for output


errHandler

public static java.io.PrintStream errHandler
Create print stream for error

Constructor Detail

Wrapper

public Wrapper()
Method Detail

addOrbRef

public static void addOrbRef(org.omg.CORBA.ORB theOrb)
Parameters:
theOrb - The Orb

collectingTrace

public static boolean collectingTrace()
Determine if trace should be passed to CICS, if it doesn't need to be then there is a significant saving in pathlength due to avoiding expensive RAS initialization.

Returns:
Indicates if CICS should be sent trace data
Since:
3.2

isSQLJPropSet

public static int isSQLJPropSet()
Has SQLJ set its property ? (also called by DTCTask.c so don't remove!) If getProperty returns null, it has not been set and returns 0, else 1

Returns:
1 if set, 0 otherwise
Since:
3.2

callUserClass

public static void callUserClass(java.lang.String[] args)
                          throws AbendException,
                                 AbendCancelException,
                                 java.lang.ThreadDeath
This callUserClass method attempts to call the CommAreaHolder variant of main() on the user's class. If that fails then it calls the String[] variant of main() on the user's class.

Parameters:
args - the input parameters
Throws:
AbendException - An Abend occurred
AbendCancelException - A Cancel occurred
java.lang.ThreadDeath - The Thread dies
Since:
4.1

set_jvmserver_disabling

public static void set_jvmserver_disabling(java.lang.String[] args)
Sets the 'being_disabled' flag on this JVMSERVER This will prevent any threads crossing into CICS code, instead they return a 'purged' exception.

Parameters:
args - the input parameters
Since:
4.1

WrapperEntry

public static int WrapperEntry(java.lang.String[] args)
Entry point into the Wrapper from DFHSJCS. args[0] is the classname of the user class args[1],args[2] are the classnames of the classes that will redirect stdout and stderr.

Parameters:
args - the input parameters
Returns:
heap utilization as a percentage
Since:
3.2

jvmServerWrapperEntry

public static void jvmServerWrapperEntry(java.lang.String[] args)
Entry point into the Wrapper for JVMSERVER threads. args[0] is the classname of the user class args[1],args[2] are the classnames of the classes that will redirect stdout and stderr.

Parameters:
args - the input parameters
Since:
4.1

jvmServerStats

public static void jvmServerStats(java.lang.String[] args)
Called by a CICS JVMServer system thread to collect statistics.

Parameters:
args - not used
Since:
4.2

jvmServerTerminate

public static void jvmServerTerminate(java.lang.String[] args)
Entry method for DFHSJTH to stop threads during the purge/kill of a JVMServer

Parameters:
args - the input parameters
Since:
4.1

main

public static void main(java.lang.String[] args)
This main method has been split into smaller methods that can be called from WrapperEntry and jvmServerWrapperEntry, in order to prevent the duplication of code. However, this main method has been left here as fully functional by calling the new methods, due to the fact that it is a public method and we cannot risk regressing existing code which may utilise it. args[0] is the classname of the user class args[1],args[2] are the classnames of the classes that will redirect stdout and stderr.

Parameters:
args - the input parameters
Since:
3.2

WrapperGC

public static int WrapperGC()
This method is invoked by the SJ domain to ensure that a full GC scan is done after the heap utilisation exceeds the threshhold

Returns:
int heapUtilization
Since:
3.2

WrapperCCStats

public static long WrapperCCStats()
Return the free space available in the Shared Class Cache

Returns:
long the amount of free space in bytes
Since:
4.1

jvmServerOSGiEntry

public static void jvmServerOSGiEntry(com.ibm.cics.osgi.ClassProxy classProxy)
Entry point into the Wrapper for OSGi JVMSERVER threads.

Parameters:
classProxy - the object that 'holds' the class or service to be targetted by the invoke call.
Since:
4.2