public class IsCobol extends Object implements IscobolCall
| Modifier and Type | Field and Description |
|---|---|
static Object[] |
NOARGS
Conventional argument indicating "no arguments" for subroutines compiled
without using the -cp option.
|
static Object[] |
NOARGS_CP
Conventional argument indicating "no arguments" for subroutines compiled
using the -cp option.
|
| Constructor and Description |
|---|
IsCobol() |
| Modifier and Type | Method and Description |
|---|---|
Object |
call(Object[] argv)
empty implementation of com.iscobol.rts.IscobolCall.call(Object[])
|
static int |
call(String name,
Object[] argv)
Enables Java programs to call COBOL programs.
|
static int |
call(String name,
Object[] argv,
boolean stopOnError)
Enables Java programs to call COBOL programs.
|
static int |
call(String name,
Object[] argv,
boolean stopOnError,
Object[] retVal)
Enables Java programs to call COBOL programs.
|
static int |
call(String name,
String[] strArgv)
Enables Java programs to call COBOL programs.
|
static int |
call(String name,
String[] strArgv,
Object[] retVal)
Enables Java programs to call COBOL programs.
|
static int |
callNoStop(String name,
Object[] argv)
Enables Java programs to call COBOL programs.
|
static int |
callNoStop(String name,
Object[] argv,
Object[] retVal)
Enables Java programs to call COBOL programs.
|
static void |
cancel(String name)
Cancels the COBOL program name previously called.
|
static void |
cancelAll()
Cancels all the COBOL programs previously called.
|
static void |
destroyIscobolEnv(Thread th)
Destroys the isCOBOL environment associated to the
th thread. |
static void |
duplicateIscobolEnv(Thread src,
Thread dst)
Duplicates the isCOBOL environment of the
src thread in the dst thread. |
static boolean |
exists(String programName)
return
true if the program specified by programName
is available in the classpath or code_prefix |
void |
finalize()
empty implementation of com.iscobol.rts.IscobolCall.finalize()
|
static String |
getEnvironment(String key)
Returns the value of a property.
|
static Map<String,String> |
getEnvironmentList()
Returns the list of the iscobol properties currently set
|
static ResultSet[] |
getResultSets()
returns the the java.sql.ResultSet instances created by the
isCOBOL application from the last call of the 'registerResultSets' method,
terminates and clears the registration
|
static String |
getStackTrace(Throwable t)
return a string containing the stack trace of the specified java.lang.Throwable object
|
static void |
loadEnvironment(File propFile)
Sets the properties contained in the specified file;
it is equivalent to
loadEnvironment(propFile, true) |
static void |
loadEnvironment(File propFile,
boolean append)
Sets the properties contained in the specified file
|
void |
perform(int begin,
int end)
empty implementation of com.iscobol.rts.IscobolModule.perform(int, int)
|
static void |
registerResultSets()
starts the registration of the java.sql.ResultSet instances created by the
isCOBOL application
|
static void |
setEnvironment(String key,
String value)
Set a property.
|
static void |
tidy()
Shutdown the isCOBOL environment.This method should be invoked before the
end of each thread.
|
public static final Object[] NOARGS
public static final Object[] NOARGS_CP
public Object call(Object[] argv)
call in interface IscobolCallpublic void perform(int begin,
int end)
perform in interface IscobolModulepublic void finalize()
finalize in interface IscobolCallfinalize in class Objectpublic static void tidy()
throws IscobolRuntimeException
IscobolRuntimeExceptionpublic static int call(String name, Object[] argv) throws IscobolRuntimeException
name - program to call;argv - Array of Objects containing the Linkage Section variables:
from the first argument this method gets if the called
program is compiled with or without -cp; in order to call
a subroutine without arguments, two conventional constants
are supplied, NOARGS and NOARGS_CP; a null value is
interpreted as NOARGS;IscobolRuntimeExceptionpublic static int call(String name, Object[] argv, boolean stopOnError) throws IscobolRuntimeException
name - program to call;argv - Array of Objects containing the Linkage Section variables:
from the first argument this method gets if the called
program is compiled with or without -cp; in order to call
a subroutine without arguments, two conventional constants
are supplied, NOARGS and NOARGS_CP; a null value is
interpreted as NOARGS;stopOnError - if true the framework stops the execution in case of
errors, otherwise the method throws an exceptionIscobolRuntimeExceptionpublic static int call(String name, Object[] argv, boolean stopOnError, Object[] retVal) throws IscobolRuntimeException
name - program to call;argv - Array of Objects containing the Linkage Section variables:
from the first argument this method gets if the called
program is compiled with or without -cp; in order to call
a subroutine without arguments, two conventional constants
are supplied, NOARGS and NOARGS_CP; a null value is
interpreted as NOARGS;stopOnError - if true the framework stops the execution in case of
errors, otherwise the method throws an exceptionretVal - When is not null and not zero length, its first element is
set with the Object returned by the CALLIscobolRuntimeExceptionpublic static int call(String name, String[] strArgv) throws IscobolRuntimeException
name - program to call;strArgv - Array of String containing the argument as if were
on the command lineIscobolRuntimeExceptionpublic static int call(String name, String[] strArgv, Object[] retVal) throws IscobolRuntimeException
name - program to call;strArgv - Array of String containing the argument as if were
on the command lineretVal - When is not null and not zero length, its first element is
set with the Object returned by the CALLIscobolRuntimeExceptionpublic static int callNoStop(String name, Object[] argv) throws StopRunAsException, IscobolRuntimeException, AssertionError
name - program to call;argv - Array of Objects containing the Linkage Section variables:
from the first argument this method gets if the called
program is compiled with or without -cp; in order to call
a subroutine without arguments, two conventional constants
are supplied, NOARGS and NOARGS_CP; a null value is
interpreted as NOARGS;StopRunAsExceptionIscobolRuntimeExceptionAssertionErrorpublic static int callNoStop(String name, Object[] argv, Object[] retVal) throws StopRunAsException, IscobolRuntimeException, AssertionError
name - program to call;argv - Array of Objects containing the Linkage Section variables:
from the first argument this method gets if the called
program is compiled with or without -cp; in order to call
a subroutine without arguments, two conventional constants
are supplied, NOARGS and NOARGS_CP; a null value is
interpreted as NOARGS;retVal - When is not null and not zero length, its first element is
set with the Object returned by the CALLStopRunAsExceptionIscobolRuntimeExceptionAssertionErrorpublic static void cancel(String name) throws IscobolRuntimeException
name - program to cancel;IscobolRuntimeExceptionpublic static void cancelAll()
throws IscobolRuntimeException
IscobolRuntimeExceptionpublic static void setEnvironment(String key, String value)
key - property name without the iscobol. prefix;value - the value of the property.public static String getEnvironment(String key)
key - property name without the iscobol. prefix;public static Map<String,String> getEnvironmentList()
public static void loadEnvironment(File propFile) throws IOException
loadEnvironment(propFile, true)propFile - the file that contains the properties to be setIOExceptionpublic static void loadEnvironment(File propFile, boolean append) throws IOException
propFile - the file that contains the properties to be setappend - when set to false removes all the properties previously set, before adding the new onesIOExceptionpublic static String getStackTrace(Throwable t)
t - the java.lang.Throwable objectpublic static void registerResultSets()
public static ResultSet[] getResultSets()
public static boolean exists(String programName)
true if the program specified by programName
is available in the classpath or code_prefixprogramName - the name of the programpublic static void duplicateIscobolEnv(Thread src, Thread dst)
src thread in the dst thread.dst thread equivalent to a thread generated by a 'CALL THREAD' statement
executed by the src thread, so it can share the configuration, the EXTERNAL variables and the connection with
the Client in Application Server environment.dst thread terminates, the destroyIscobolEnv(dst) method should be invoked.src - the source threaddst - the destination threadpublic static void destroyIscobolEnv(Thread th)
th thread.duplicateIscobolEnv method terminatesth - the thread to be associated with the isCOBOL environment