private static class ControlFlowOps.InternalEntryCaller
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
ControlFlowOps.InternalEntryCaller.CacheKey
A cache key which encapsulates the name of a method, its signature and containing class,
and whether that method represents a converted Progress function or a procedure.
|
private static class |
ControlFlowOps.InternalEntryCaller.CacheValue
A data structure for the cache's values.
|
Modifier and Type | Field and Description |
---|---|
private static Cache<ControlFlowOps.InternalEntryCaller.CacheKey,ControlFlowOps.InternalEntryCaller.CacheValue> |
cache
Cache of methods by type, name, class, and signature
|
protected java.lang.Object |
callerInstance
The external program instance where the internal entry's body is defined.
|
protected java.lang.String |
iename
The legacy 4GL name of this internal entry.
|
protected java.lang.String |
methodName
The java name of this internal entry.
|
private java.lang.reflect.Method |
mthd
The
Method instance for this internal entry. |
private handle |
phandle
The handle associated with the
callerInstance . |
Constructor and Description |
---|
InternalEntryCaller()
Basic c'tor.
|
InternalEntryCaller(handle phandle,
java.lang.String methodName,
java.lang.String iename)
Configure this instance to invoke the given internal entry.
|
Modifier and Type | Method and Description |
---|---|
private ControlFlowOps.InternalEntryCaller.CacheValue |
getCache(ControlFlowOps.InternalEntryCaller.CacheKey key)
Get a cached value, if any, for the given key.
|
(package private) java.lang.Object |
getCallerInstance()
Get the external program instance where this internal entry is
defined.
|
(package private) java.lang.String |
getClassName()
Get the class name of the external program to which this internal
entry belongs.
|
(package private) java.lang.String |
getExternalProgramName()
Get the legacy name of the external program where the execution will take place.
|
(package private) java.lang.String |
getInternalEntryName()
Get the legacy name of this internal entry.
|
(package private) java.lang.String |
getMethodName()
Get the java method name for this internal entry.
|
(package private) java.lang.String |
getParameterModes(boolean function)
Get the string representation of the parameter modes defined for this
internal entry.
|
(package private) java.util.List<Parameter> |
getParameters(boolean function)
Get the parameters defined for this internal entry.
|
(package private) handle |
getPhandle()
Get the
phandle field. |
(package private) java.lang.Class<?>[] |
getSignature(java.lang.Object... param)
Get the signature, as defined by the parameters.
|
(package private) java.lang.Object |
invoke(java.lang.String modes,
java.lang.Object... param)
Invoke the internal entry, using the
mthd ,
the callerInstance and the passed arguments. |
(package private) java.lang.Object |
invokeImpl(java.lang.String modes,
java.lang.Object... param)
Invoke the internal entry, using the
mthd ,
the callerInstance and the passed arguments. |
private void |
putCache(ControlFlowOps.InternalEntryCaller.CacheKey key,
java.lang.reflect.Method method,
ControlFlowOps.ArgValidationErrors returnValue,
boolean exactMatch)
Cache the specified information under the given cache key.
|
(package private) ControlFlowOps.ArgValidationErrors |
valid(boolean function,
java.lang.String modes,
int[] extentInfo,
java.lang.Object... param)
Validate the given parameters against the method's real signature using the corresponding
parameter passing mode:
INPUTIf the parameter's type is compatible with the real type
(from the
method's arguments), then cast it to it. |
private static final Cache<ControlFlowOps.InternalEntryCaller.CacheKey,ControlFlowOps.InternalEntryCaller.CacheValue> cache
protected java.lang.Object callerInstance
protected java.lang.String methodName
protected java.lang.String iename
private java.lang.reflect.Method mthd
Method
instance for this internal entry.private handle phandle
callerInstance
.public InternalEntryCaller()
public InternalEntryCaller(handle phandle, java.lang.String methodName, java.lang.String iename)
phandle
- The procedure handle where the internal entry's body is
defined.methodName
- The resolved java name for this internal entry.iename
- The legacy 4GL name of this internal entry.final java.lang.Object invoke(java.lang.String modes, java.lang.Object... param) throws java.lang.Exception
mthd
,
the callerInstance
and the passed arguments.
It performs an additional check, in case of remote invocation calls originating from
external, customer-specific application (when ControlFlowOps.WorkArea.remoteInvoke
flag is set):
access to the external program must be allowed via a RemoteEntryPointResource
ACL.
modes
- An encoded string with the mode of each parameter specified as a
character in the string.param
- The arguments for this Java method call.java.lang.Exception
- If any exceptions are encountered during method invocation.java.lang.Object invokeImpl(java.lang.String modes, java.lang.Object... param) throws java.lang.Exception
mthd
,
the callerInstance
and the passed arguments.modes
- An encoded string with the mode of each parameter specified as a
character in the string.param
- The arguments for this Java method call.java.lang.Exception
- If any exceptions are encountered during method invocation.java.lang.Class<?>[] getSignature(java.lang.Object... param)
param
- The arguments for this Java method call.ControlFlowOps.ArgValidationErrors valid(boolean function, java.lang.String modes, int[] extentInfo, java.lang.Object... param)
method's
arguments), then cast it to it.
method's
arguments), the use a default value for the
expected type. The compatibility assures the conversion will be possible at
return time.
ControlFlowOps.ArgValidationErrors.NO_ERROR
is returned. Else:
ControlFlowOps.ArgValidationErrors.INCORRECT_COUNT
is returned.ControlFlowOps.ArgValidationErrors.INCORRECT_TYPES
is returned.function
- true
if this is a function call.modes
- The types of parameters: INPUT(I) / OUTPUT (O) / INPUT-OUTPUT (U).extentInfo
- An output parameter array that provides the caller with additional information
about the extent sizes when they don't match. The first item is the size of the
argument (provided extent), the second is the parameter (expected extent).param
- The arguments for this Java method call.ControlFlowOps.ArgValidationErrors
constants.java.lang.String getMethodName()
java.lang.String getClassName()
java.lang.Object getCallerInstance()
java.lang.String getInternalEntryName()
java.lang.String getExternalProgramName()
java.lang.String getParameterModes(boolean function)
function
- true
if this is a function call.java.util.List<Parameter> getParameters(boolean function)
function
- true
if this is a function call.private ControlFlowOps.InternalEntryCaller.CacheValue getCache(ControlFlowOps.InternalEntryCaller.CacheKey key)
key
- Cache key.null
.private void putCache(ControlFlowOps.InternalEntryCaller.CacheKey key, java.lang.reflect.Method method, ControlFlowOps.ArgValidationErrors returnValue, boolean exactMatch)
key
- Cache key.method
- Method found matching a given name and signature, or null
if no
match was found.returnValue
- Enumerated return value for valid(boolean, String, int[], Object...)
method.exactMatch
- true
to indicate the method signature stored in the key exactly
matches that of the cached method; false
to indicate one or more
method arguments needs to be converted to a compatible type.