public interface RexxHandler
Please note: these methods allow interfacing with the running instance
of the Rexx interpreter instance on the same (!) thread in which the Rexx command
or Rexx exit Java handler got invoked on.
It is necessary to supply the opaque argument named slot from the Java handler
methods unaltered.
If neither of these two restrictions holds, then the results of executing any of these
static methods will be undefined, mostlikely tearing down ooRexx and Java!
------------------------ Apache Version 2.0 license ------------------------- Copyright (C) 2012-2022 Rony G. Flatscher Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -----------------------------------------------------------------------------
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
version
Version string indicating version of this class (majorVersion*100+minorVersion
concatenated with a dot and the sorted date of last change.
|
Modifier and Type | Method and Description |
---|---|
default boolean |
checkCondition(java.lang.Object slot)
Checks to see if any conditions have resulted from a call to a Rexx API (cf "rexxpg.pdf").
|
default void |
clearCondition(java.lang.Object slot)
Clears any pending condition status (cf "rexxpg.pdf").
|
default void |
dropContextVariable(java.lang.Object slot,
java.lang.String variableName)
Drops a Rexx variable from the context.
|
default java.lang.Object |
getAllContextVariables(java.lang.Object slot)
Fetches and returns a Rexx directory containing all context variables.
|
default java.lang.Object |
getCallerContext(java.lang.Object slot)
Returns the Rexx context object
.context that can be analyzed to learn about the context
of the command/exit. |
default java.lang.Object |
getConditionInfo(java.lang.Object slot)
Returns a directory object containing the condition information; this is equivalent to calling
condition('O') from within Rexx code (cf "rexxpg.pdf"). |
default java.lang.Object |
getContextVariable(java.lang.Object slot,
java.lang.String variableName)
Fetches and returns the Rexx variable value in the Rexx program for which the handler runs.
|
default java.lang.Object |
getGlobalEnvironment(java.lang.Object slot)
Returns a reference to the Rexx interpreter global
.environment directory. |
default long |
getInterpreterVersion(java.lang.Object slot)
(Copied from the ooRexx rexxpg.pdf documentation) "Returns
the version of the interpreter.
|
default long |
getLanguageLevel(java.lang.Object slot)
(Copied from the ooRexx rexxpg.pdf documentation) "Returns the language level of
the interpreter.
|
default java.lang.Object |
getLocalEnvironment(java.lang.Object slot)
Returns a reference to this Rexx interpreter instance
.local environment directory. |
default java.lang.Object |
getNil(java.lang.Object slot)
Returns a reference to the Rexx sentinel value
.nil . |
default void |
haltThread(java.lang.Object slot)
Raises a
HALT condition on the current (Rexx) thread. |
default java.lang.Object |
newArray(java.lang.Object slot)
Returns a newly created ooRexx
Array collection object. |
default java.lang.Object |
newDirectory(java.lang.Object slot)
Returns a newly created ooRexx
Directory collection object. |
default java.lang.Object |
newStem(java.lang.Object slot,
java.lang.String stemName)
Returns a newly created ooRexx
Stem collection object. |
default java.lang.Object |
newStringTable(java.lang.Object slot)
Returns a newly created ooRexx
StringTable collection object. |
default void |
raiseCondition(java.lang.Object slot,
java.lang.String conditionName,
java.lang.String description,
java.lang.Object[] additional,
java.lang.Object result)
Raises a condition in the current Rexx thread, pass-through method to the Rexx API, which
should be called immediately before returning to Rexx.
|
default void |
raiseException(java.lang.Object slot,
long definedErrorNumber,
java.lang.Object[] substitutions)
Raises a Rexx error of the given error number, call immediately before returning from
Java.
|
default void |
raiseException0(java.lang.Object slot,
long definedErrorNumber)
Raises a Rexx error without substitution values of the given error number, call immediately before returning from
Java.
|
default void |
raiseException1(java.lang.Object slot,
long definedErrorNumber,
java.lang.String substitution1)
Raises a Rexx error of the given error number, call immediately before returning from
Java.
|
default void |
raiseException2(java.lang.Object slot,
long definedErrorNumber,
java.lang.String substitution1,
java.lang.String substitution2)
Raises a Rexx error of the given error number, call immediately before returning from
Java.
|
default void |
setContextVariable(java.lang.Object slot,
java.lang.String variableName,
java.lang.Object variableValue)
Allows to set a variable with a value in the Rexx program for which the handler runs.
|
default void |
setContextVariableToNil(java.lang.Object slot,
java.lang.String variableName)
Allows to set a variable to
.nil in the Rexx program for which the handler runs. |
default void |
setThreadTrace(java.lang.Object slot,
boolean state)
Sets the interactive trace state for the current thread.
|
static final java.lang.String version
default void raiseCondition(java.lang.Object slot, java.lang.String conditionName, java.lang.String description, java.lang.Object[] additional, java.lang.Object result)
rexxapi.pdf
, 9.14.126. RaiseCondition.slot
- opaque argument supplied to the handler methods by the Rexx native
code interfaceconditionName
- Rexx condition name, usually "ERROR"
or "FAILURE"
description
- optional String describing the conditionadditional
- optional additional objectresult
- optional result object, if routine or method does not trap the condition;
may contain the error or failure numberdefault void raiseException(java.lang.Object slot, long definedErrorNumber, java.lang.Object[] substitutions)
definedErrorNumber
has to be calculated as
errorNumber*1000+subcode
. Cf. the ooRexx reference manual (rexxref.pdf
),
"Appendix C. Error Numbers and Messages".slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectdefinedErrorNumber
- errorNumber*1000+subcode
substitutions
- an Object array containing substitution values for the error message (if
more entries get added, then they can be retrieved by ooRexx using the additional method
of the condition object)default void raiseException0(java.lang.Object slot, long definedErrorNumber)
definedErrorNumber
has to be calculated as
errorNumber*1000+subcode
. Cf. the ooRexx reference manual (rexxref.pdf
),
"Appendix C. Error Numbers and Messages".slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectdefinedErrorNumber
- errorNumber*1000+subcode
default void raiseException1(java.lang.Object slot, long definedErrorNumber, java.lang.String substitution1)
definedErrorNumber
has to be calculated as
errorNumber*1000+subcode
. Cf. the ooRexx reference manual (rexxref.pdf
),
"Appendix C. Error Numbers and Messages".slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectdefinedErrorNumber
- errorNumber*1000+subcode
substitution1
- String used as the first substition value for the error messagedefault void raiseException2(java.lang.Object slot, long definedErrorNumber, java.lang.String substitution1, java.lang.String substitution2)
definedErrorNumber
has to be calculated as
errorNumber*1000+subcode
. Cf. the ooRexx reference manual (rexxref.pdf
),
"Appendix C. Error Numbers and Messages".slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectdefinedErrorNumber
- errorNumber*1000+subcode
substitution1
- String used as the first substition value for the error messagesubstitution2
- String used as the second substition value for the error messagedefault java.lang.Object getAllContextVariables(java.lang.Object slot)
slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectdefault java.lang.Object getContextVariable(java.lang.Object slot, java.lang.String variableName)
slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectvariableName
- name of the Rexx variabledefault void setContextVariable(java.lang.Object slot, java.lang.String variableName, java.lang.Object variableValue)
slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectvariableName
- name of the Rexx variablevariableValue
- the Rexx variable should be set todefault void setContextVariableToNil(java.lang.Object slot, java.lang.String variableName)
.nil
in the Rexx program for which the handler runs.slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectvariableName
- name of the Rexx variabledefault void dropContextVariable(java.lang.Object slot, java.lang.String variableName)
slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectvariableName
- name of the Rexx variabledefault java.lang.Object newArray(java.lang.Object slot)
Array
collection object.slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectdefault java.lang.Object newDirectory(java.lang.Object slot)
Directory
collection object.slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectdefault java.lang.Object newStem(java.lang.Object slot, java.lang.String stemName)
Stem
collection object.slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectstemName
- the stem's base namedefault java.lang.Object newStringTable(java.lang.Object slot)
StringTable
collection object.slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectdefault boolean checkCondition(java.lang.Object slot)
slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objecttrue
, if Rexx condition is set, false
elsedefault void clearCondition(java.lang.Object slot)
slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectdefault java.lang.Object getConditionInfo(java.lang.Object slot)
condition('O')
from within Rexx code (cf "rexxpg.pdf").slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectRexxProxy
for a Rexx Directory object or NULL
, if no
pending Rexx conditiondefault java.lang.Object getCallerContext(java.lang.Object slot)
.context
that can be analyzed to learn about the context
of the command/exit.slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectRexxProxy
for the Rexx .context
objectdefault void setThreadTrace(java.lang.Object slot, boolean state)
slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectstate
- new state for interactive tracedefault void haltThread(java.lang.Object slot)
HALT
condition on the current (Rexx) thread.slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectdefault java.lang.Object getLocalEnvironment(java.lang.Object slot)
.local
environment directory.slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectRexxProxy
for the Rexx .local
objectdefault java.lang.Object getGlobalEnvironment(java.lang.Object slot)
.environment
directory.slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectRexxProxy
for the Rexx .environment
objectdefault java.lang.Object getNil(java.lang.Object slot)
.nil
.slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectRexxProxy
referring to the .nil
objectdefault long getInterpreterVersion(java.lang.Object slot)
0x00050000
for version 5.0.0."slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
objectdefault long getLanguageLevel(java.lang.Object slot)
0x00000603
for language level 6.03."slot
- an opaque Object array as passed to the RexxExitHandler
or RexxCommandHandler
object