public class SharedVariableManager extends java.lang.Object implements Scopeable, ScopeableFactory
All references can be added to the top scope (closest enclosing scope) or
to the global scope. Lookups return the topmost reference by the given
name or null
if no reference by that name exists. The backing
function is provided by the ScopedSymbolDictionary
and this class
exposes the necessary helpers as static methods which de-reference the
pool that is localized to the context that is specific to the current
authenticated user. Please see SecurityManager
for more
details on this facility.
The resource dictionaries (pools) are separate since they require
different namespaces. Where possible, the returned reference is of
a specific type, but at this time for all non-stream and non-temp table
resources, only Object
references can be returned.
Buffers are persistent object representations of relational database records.
Temp tables are actually buffers which point to temp tables, but this is simply an implementation detail. They represent shared temp table definitions, as opposed to shared buffers. They are managed separate from regular buffers to ensure a separate namespace is available.
Frames are object representations of a screen buffer that is specific to a given user-defined visual layout.
Implements the Scopeable
interface to allow this class to be
automatically notified of all scope start and end occurrences. This removes
the need for client code to be instrumented to provide this service. The
use of this class is now tied to the TransactionManager
class. In
particular, the singleton instance of this class is used in each context-
local list of Scopeable
objects as a dispatcher. This bit
of nastiness is necessary since the Java Interface can't be implemented
on a static basis but instead requires an instance method implementation.
These instance methods then call the static counterparts which is where
the content-local versions of the resource pools are accessed.
The initialization processing is implemented in the initialize()
method and it is called during server startup based on an entry in the
directory until the path "/server/<serverId>/startup" or in
"/server/default/startup".
Modifier and Type | Class and Description |
---|---|
private static class |
SharedVariableManager.BufferRegistry
A registry for BUFFER resources.
|
private static class |
SharedVariableManager.PersistentRegistry
A registry for resources which exist with the persistent procedure.
|
private static class |
SharedVariableManager.PersistentShares<T extends SharedVariableManager.PersistentRegistry>
Common behavior for all shared resources which are in sync with the persistent procedure
state.
|
private static class |
SharedVariableManager.SharedRegistry
Stores the registry for a specified shared resource.
|
private static class |
SharedVariableManager.VarRegistry
Container for the registries related to shared variables.
|
private static class |
SharedVariableManager.WorkArea
Stores the state of the current context.
|
Modifier and Type | Field and Description |
---|---|
private static ContextLocal<SharedVariableManager.WorkArea> |
local
Context-local state related to shared variables.
|
private static boolean |
registered
Flag to detect and avoid attempts to initialize more than once.
|
private static SharedVariableManager |
single
Singleton instance of this class (across entire JVM, all contexts).
|
Constructor and Description |
---|
SharedVariableManager() |
Modifier and Type | Method and Description |
---|---|
static <T> void |
addBuffer(ScopeLevel scope,
java.lang.String name,
T buffer)
Adds a buffer to the specified scope.
|
static <T> void |
addBuffer(java.lang.String name,
T buffer)
Adds a buffer to the
ScopeLevel.CURRENT scope. |
static <T> T |
addFrame(ScopeLevel scope,
java.lang.String name,
T frame)
Adds a frame to the specified scope.
|
static <T> T |
addFrame(java.lang.String name,
T frame)
Adds a frame to the
ScopeLevel.NEXT scope. |
static <T> void |
addMenu(ScopeLevel scope,
java.lang.String name,
T menu)
Adds a menu to the specified scope.
|
static <T> void |
addMenu(java.lang.String name,
T menu)
Adds a menu definition to the
ScopeLevel.NEXT scope. |
static void |
addStream(ScopeLevel scope,
java.lang.String name,
Stream stream)
Adds a stream to the specified scope.
|
static void |
addStream(java.lang.String name,
Stream stream)
Adds a stream to the
ScopeLevel.CURRENT scope. |
static <T extends Temporary> |
addTempTable(ScopeLevel scope,
java.lang.String name,
java.lang.Class<T> dmoBufIface,
java.lang.String variable,
java.lang.String legacyName)
Creates (via
TemporaryBuffer.define(java.lang.Class<T>, java.lang.String, boolean) and adds a temporary table buffer to the
specified scope. |
static <T extends Temporary> |
addTempTable(ScopeLevel scope,
java.lang.String name,
java.lang.Class<T> dmoBufIface,
java.lang.String variable,
java.lang.String legacyName,
boolean undoable)
Creates (via
TemporaryBuffer.define(java.lang.Class<T>, java.lang.String, boolean) and adds a temporary table buffer to the
specified scope. |
static <T extends Temporary> |
addTempTable(java.lang.String name,
java.lang.Class<T> dmoBufIface,
java.lang.String variable,
java.lang.String legacyName)
Creates (via
TemporaryBuffer.define(java.lang.Class<T>, java.lang.String, boolean) and adds a temporary table buffer to the next
scope - the instance will be placed in the list of deferred instances that will be added
the next time a scope is opened. |
static <T extends Temporary> |
addTempTable(java.lang.String name,
java.lang.Class<T> dmoBufIface,
java.lang.String variable,
java.lang.String legacyName,
boolean undoable)
Creates (via
TemporaryBuffer.define(java.lang.Class<T>, java.lang.String, boolean) and adds a temporary table buffer to the next
scope - the instance will be placed in the list of deferred instances that will be added
the next time a scope is opened. |
static <T> T |
addVariable(ScopeLevel scope,
java.lang.String name,
boolean noUndo,
T var)
Adds a variable to the specified scope.
|
static <T> T |
addVariable(ScopeLevel scope,
java.lang.String name,
boolean noUndo,
T var,
java.util.function.Supplier<java.lang.Object> init)
Adds a variable to the specified scope.
|
static <T> T |
addVariable(ScopeLevel scope,
java.lang.String name,
T var)
Adds a variable to the specified scope.
|
static <T> T |
addVariable(ScopeLevel scope,
java.lang.String name,
T var,
java.util.function.Supplier<java.lang.Object> init)
Adds a variable to the specified scope.
|
static <T> T |
addVariable(java.lang.String name,
boolean noUndo,
T var)
Adds a variable to the next scope that is opened.
|
static <T> T |
addVariable(java.lang.String name,
boolean noUndo,
T var,
java.util.function.Supplier<java.lang.Object> init)
Adds a variable to the next scope that is opened.
|
static <T> T |
addVariable(java.lang.String name,
T var)
Adds a variable to the next scope that is opened.
|
static <T> T |
addVariable(java.lang.String name,
T var,
java.util.function.Supplier<java.lang.Object> init)
Adds a variable to the next scope that is opened.
|
private static void |
addWorker(SharedVariableManager.SharedRegistry sr,
ScopeLevel scope,
java.lang.String name,
java.lang.Object var)
Core add worker that defers adding (using a pending list in the work area) if this is a
ScopeLevel.NEXT request, otherwise the instance will be mapped into the current
or global scope immediately. |
private static boolean |
checkSharedResource(java.util.function.BooleanSupplier pred,
java.lang.Runnable error)
Check if the specified match condition is
true . |
private static void |
checkSharedTempTable(java.lang.Object found,
java.lang.String name,
java.lang.Class<? extends Temporary> expected)
Check if the shared temp-table DMO class matches the found master temp-table.
|
private static void |
checkSharedVariable(java.lang.String name,
java.lang.Object var,
boolean noUndo)
Check if the defined shared variable matches the existing master variable.
|
static void |
cleanupBuffer(BufferReference buffer)
Cleanup the
SharedVariableManager.WorkArea.bufferCreator for the specific buffer instance. |
(package private) static void |
cleanupPending()
Cleanup the pending shared resources, as external program instantiation failed.
|
Scopeable |
createScopeable()
Provides the singleton instance of this class as a
Scopeable . |
private static void |
errorHelper(int num,
java.lang.String msg)
Simple helper to construct a
ErrorConditionException and throw it, when needed. |
static SharedVariableManager |
getInstance()
Implements the singleton nature of this class, constructs this instance
if it hasn't already been constructed.
|
static void |
initialize()
Initialize the shared variable framework.
|
static <T> T |
lookupBuffer(java.lang.String name,
java.lang.String ttname,
java.lang.Class<?> expected)
Searches all scopes from the top of the stack down for the first buffer with the given name.
|
static <T> T |
lookupFrame(java.lang.String name)
Searches all scopes from the top of the stack down for the first frame with the given name.
|
static <T> T |
lookupMenu(java.lang.String name)
Searches all scopes from the top of the stack down for the first menu with the given name.
|
static Stream |
lookupStream(java.lang.String name)
Searches all scopes from the top of the stack down for the first
stream with the given name.
|
static <T extends Temporary> |
lookupTempTable(java.lang.String name,
java.lang.Class<T> expected)
Searches all scopes from the top of the stack down for the first temp
table with the given name.
|
static <T> T |
lookupVariable(java.lang.String name,
java.lang.Class<? extends BaseDataType> expected)
Searches all scopes from the top of the stack down for the first variable with the given
name.
|
static <T> T |
lookupVariable(java.lang.String name,
java.lang.Class<? extends BaseDataType> expected,
boolean noUndo)
Searches all scopes from the top of the stack down for the first variable with the given
name.
|
static <T> T |
lookupVariable(java.lang.String name,
java.lang.Class<? extends BaseDataType> expected,
java.lang.Integer extent)
Searches all scopes from the top of the stack down for the first variable with the given
name.
|
static <T> T |
lookupVariable(java.lang.String name,
java.lang.Class<? extends BaseDataType> expected,
java.lang.Integer extent,
boolean noUndo)
Searches all scopes from the top of the stack down for the first variable with the given
name.
|
private static java.lang.Object |
lookupWorker(SharedVariableManager.PersistentShares<?> pshare,
java.lang.String name,
java.lang.Runnable error)
Core lookup worker that returns the first instance found by the given name.
|
private static java.lang.Object |
lookupWorker(SharedVariableManager.SharedRegistry sr,
java.lang.String name,
java.lang.Runnable error)
Core lookup worker that returns the first instance found by the
given name.
|
void |
scopeDeleted()
Provides notification that the external procedure scope has been deleted.
|
void |
scopeFinished()
Provides a notification that a scope is about to be exited.
|
void |
scopeStart()
Provides a notification that a new scope is about to be entered.
|
(package private) static <T extends BaseDataType> |
updateExtentVar(T[] array,
T[] copy)
Update the references for the specified array, as a result of a resize.
|
private static boolean |
variablesMatch(java.lang.String name,
java.lang.Object var,
boolean noUndo)
Check if the candidate slave shared variable matches an existing master variable.
|
private static ContextLocal<SharedVariableManager.WorkArea> local
private static SharedVariableManager single
private static boolean registered
public static SharedVariableManager getInstance()
public static void initialize()
TransactionManager
a factory object which
creates a Scopeable
instance.java.lang.IllegalStateException
- If invoked more than once.public static <T> T addVariable(java.lang.String name, T var)
T
- Variable type.name
- The variable name.var
- The variable reference.var
instance given if it is successfully
added, otherwise the currently registered global instance
with the same name.public static <T> T addVariable(java.lang.String name, T var, java.util.function.Supplier<java.lang.Object> init)
T
- Variable type.name
- The variable name.var
- The variable reference.init
- If non null, then var is assumed to be an extent variable, and this represents
the default value for the variable's elements.var
instance given if it is successfully
added, otherwise the currently registered global instance
with the same name.public static <T> T addVariable(ScopeLevel scope, java.lang.String name, T var)
If the next scope is specified, the instance will be placed in the list of deferred instances that will be added the next time a scope is opened.
If global is specified, the instance will be added to the bottom-most scope on the stack.
If current is specified, the instance will be added to the scope that is on the top of the stack. If there is only one scope on the stack, the global and current scope will be the same scope.
Any attempt to add second global variable of the same name, will cause the passed-in instance to be ignored (the currently registered instance will not be replaced). In addition, the currently registered instance will be returned.
T
- Variable type.scope
- Specifies the target scope.name
- The variable name.var
- The variable reference.var
instance given if it is successfully
added, otherwise the currently registered global instance
with the same name.public static <T> T addVariable(java.lang.String name, boolean noUndo, T var)
T
- Variable type.noUndo
- Flag indicating if the variable was defined as NO-UNDO.name
- The variable name.var
- The variable reference.var
instance given if it is successfully
added, otherwise the currently registered global instance
with the same name.public static <T> T addVariable(java.lang.String name, boolean noUndo, T var, java.util.function.Supplier<java.lang.Object> init)
T
- Variable type.name
- The variable name.noUndo
- Flag indicating if the variable was defined as NO-UNDO.var
- The variable reference.init
- If non null, then var is assumed to be an extent variable, and this represents
the default value for the variable's elements.var
instance given if it is successfully
added, otherwise the currently registered global instance
with the same name.public static <T> T addVariable(ScopeLevel scope, java.lang.String name, boolean noUndo, T var)
If the next scope is specified, the instance will be placed in the list of deferred instances that will be added the next time a scope is opened.
If global is specified, the instance will be added to the bottom-most scope on the stack.
If current is specified, the instance will be added to the scope that is on the top of the stack. If there is only one scope on the stack, the global and current scope will be the same scope.
Any attempt to add second global variable of the same name, will cause the passed-in instance to be ignored (the currently registered instance will not be replaced). In addition, the currently registered instance will be returned.
T
- Variable type.scope
- Specifies the target scope.name
- The variable name.noUndo
- Flag indicating if the variable was defined as NO-UNDO.var
- The variable reference.var
instance given if it is successfully
added, otherwise the currently registered global instance
with the same name.public static <T> T addVariable(ScopeLevel scope, java.lang.String name, T var, java.util.function.Supplier<java.lang.Object> init)
If the next scope is specified, the instance will be placed in the list of deferred instances that will be added the next time a scope is opened.
If global is specified, the instance will be added to the bottom-most scope on the stack.
If current is specified, the instance will be added to the scope that is on the top of the stack. If there is only one scope on the stack, the global and current scope will be the same scope.
Any attempt to add second global variable of the same name, will cause the passed-in instance to be ignored (the currently registered instance will not be replaced). In addition, the currently registered instance will be returned.
T
- Variable type.scope
- Specifies the target scope.name
- The variable name.var
- The variable reference.init
- If non null, then var is assumed to be an extent variable, and this represents
the default value for the variable's elements.var
instance given if it is successfully
added, otherwise the currently registered global instance
with the same name.public static <T> T addVariable(ScopeLevel scope, java.lang.String name, boolean noUndo, T var, java.util.function.Supplier<java.lang.Object> init)
If the next scope is specified, the instance will be placed in the list of deferred instances that will be added the next time a scope is opened.
If global is specified, the instance will be added to the bottom-most scope on the stack.
If current is specified, the instance will be added to the scope that is on the top of the stack. If there is only one scope on the stack, the global and current scope will be the same scope.
Any attempt to add second global variable of the same name, will cause the passed-in instance to be ignored (the currently registered instance will not be replaced). In addition, the currently registered instance will be returned.
T
- Variable type.scope
- Specifies the target scope.name
- The variable name.noUndo
- Flag indicating if the variable was defined as NO-UNDO.var
- The variable reference.init
- If non null, then var is assumed to be an extent variable, and this represents
the default value for the variable's elements.var
instance given if it is successfully
added, otherwise the currently registered global instance
with the same name.public static <T> T lookupVariable(java.lang.String name, java.lang.Class<? extends BaseDataType> expected) throws ErrorConditionException
T
- Variable type.name
- The variable name.expected
- The defined type of the slave variable (must match the master var type).null
if not found.ErrorConditionException
- When the variable cannot be found or it does not match the master.public static <T> T lookupVariable(java.lang.String name, java.lang.Class<? extends BaseDataType> expected, boolean noUndo) throws ErrorConditionException
T
- Variable type.name
- The variable name.expected
- The defined type of the slave variable (must match the master var type).noUndo
- Flag indicating if the variable was defined as NO-UNDO.null
if not found.ErrorConditionException
- When the variable cannot be found or it does not match the master.public static <T> T lookupVariable(java.lang.String name, java.lang.Class<? extends BaseDataType> expected, java.lang.Integer extent) throws ErrorConditionException
T
- Variable type.name
- The variable name.expected
- The defined type of the slave variable (must match the master var type).extent
- The found var must be an extent var of the specified extent.null
if not found.ErrorConditionException
- When the variable cannot be found or it does not match the master.public static <T> T lookupVariable(java.lang.String name, java.lang.Class<? extends BaseDataType> expected, java.lang.Integer extent, boolean noUndo) throws ErrorConditionException
T
- Variable type.name
- The variable name.expected
- The defined type of the slave variable (must match the master var type).extent
- The found var must be an extent var of the specified extent.noUndo
- Flag indicating if the variable was defined as NO-UNDO.null
if not found.ErrorConditionException
- When the variable cannot be found or it does not match the master.public static void addStream(java.lang.String name, Stream stream)
ScopeLevel.CURRENT
scope.name
- The stream name.stream
- The stream reference.public static void addStream(ScopeLevel scope, java.lang.String name, Stream stream)
If the next scope is specified, the instance will be placed in the list of deferred instances that will be added the next time a scope is opened.
If global is specified, the instance will be added to the bottom-most scope on the stack.
If current is specified, the instance will be added to the scope that is on the top of the stack. If there is only one scope on the stack, the global and current scope will be the same scope.
scope
- Specifies the target scope.name
- The stream name.stream
- The stream reference.public static Stream lookupStream(java.lang.String name) throws ErrorConditionException
name
- The stream name.null
if not found.ErrorConditionException
- When the stream cannot be found and silent error mode is
disabled.public static <T> void addBuffer(java.lang.String name, T buffer)
ScopeLevel.CURRENT
scope.name
- The buffer name.buffer
- The buffer reference.public static <T> void addBuffer(ScopeLevel scope, java.lang.String name, T buffer)
If the next scope is specified, the instance will be placed in the list of deferred instances that will be added the next time a scope is opened.
If global is specified, the instance will be added to the bottom-most scope on the stack.
If current is specified, the instance will be added to the scope that is on the top of the stack. If there is only one scope on the stack, the global and current scope will be the same scope.
T
- Buffer type.scope
- Specifies the target scope.name
- The buffer name.buffer
- The buffer reference.public static <T> T lookupBuffer(java.lang.String name, java.lang.String ttname, java.lang.Class<?> expected) throws ErrorConditionException
T
- Buffer type.name
- The buffer name.ttname
- The temp-table name.expected
- The expected DMO type of the resolved buffer.null
if not found.ErrorConditionException
- When the buffer cannot be found or it does not match the master.public static <T extends Temporary> T addTempTable(java.lang.String name, java.lang.Class<T> dmoBufIface, java.lang.String variable, java.lang.String legacyName, boolean undoable)
TemporaryBuffer.define(java.lang.Class<T>, java.lang.String, boolean)
and adds a temporary table buffer to the next
scope - the instance will be placed in the list of deferred instances that will be added
the next time a scope is opened.T
- Type of constructed instance.name
- The temporary table buffer name.dmoBufIface
- Interface which defines DMO's public API. This must be a sub-interface of
Temporary
.variable
- Name of the variable with which the record buffer will be associated in the
transaction manager.legacyName
- Legacy name of the temp-table.undoable
- true
if changes made to records managed by this buffer can be undone;
false
if such changes are committed immediately, such that they cannot
be undone.public static <T extends Temporary> T addTempTable(java.lang.String name, java.lang.Class<T> dmoBufIface, java.lang.String variable, java.lang.String legacyName)
TemporaryBuffer.define(java.lang.Class<T>, java.lang.String, boolean)
and adds a temporary table buffer to the next
scope - the instance will be placed in the list of deferred instances that will be added
the next time a scope is opened.T
- Type of constructed instance.name
- The temporary table buffer name.dmoBufIface
- Interface which defines DMO's public API. This must be a sub-interface of
Temporary
.variable
- Name of the variable with which the record buffer will be associated in the
transaction manager.legacyName
- Legacy name of the temp-table.public static <T extends Temporary> T addTempTable(ScopeLevel scope, java.lang.String name, java.lang.Class<T> dmoBufIface, java.lang.String variable, java.lang.String legacyName)
TemporaryBuffer.define(java.lang.Class<T>, java.lang.String, boolean)
and adds a temporary table buffer to the
specified scope.
If the next scope is specified, the instance will be placed in the list of deferred instances that will be added the next time a scope is opened.
If global is specified, the instance will be added to the bottom-most scope on the stack.
Also, first, existing temp-tables with the same name are searched - if one is found in one
of the previous scopes, then that temp-table is returned only if its DMO interface is the
same as or it implements the specified dmoBufIface
If current is specified, the instance will be added to the scope that is on the top of the stack. If there is only one scope on the stack, the global and current scope will be the same scope.
T
- Type of constructed instance.scope
- Specifies the target scope.name
- The temporary table buffer name.dmoBufIface
- Interface which defines DMO's public API. This must be a sub-interface of
Temporary
.variable
- Name of the variable with which the record buffer will be associated in the
transaction manager.legacyName
- Legacy name of the temp-table.public static <T extends Temporary> T addTempTable(ScopeLevel scope, java.lang.String name, java.lang.Class<T> dmoBufIface, java.lang.String variable, java.lang.String legacyName, boolean undoable)
TemporaryBuffer.define(java.lang.Class<T>, java.lang.String, boolean)
and adds a temporary table buffer to the
specified scope.
If the next scope is specified, the instance will be placed in the list of deferred instances that will be added the next time a scope is opened.
If global is specified, the instance will be added to the bottom-most scope on the stack.
Also, first, existing temp-tables with the same name are searched - if one is found in one
of the previous scopes, then that temp-table is returned only if its DMO interface is the
same as or it implements the specified dmoBufIface
If current is specified, the instance will be added to the scope that is on the top of the stack. If there is only one scope on the stack, the global and current scope will be the same scope.
T
- Type of constructed instance.scope
- Specifies the target scope.name
- The temporary table buffer name.dmoBufIface
- Interface which defines DMO's public API. This must be a sub-interface of
Temporary
.variable
- Name of the variable with which the record buffer will be associated in the
transaction manager.legacyName
- Legacy name of the temp-table.undoable
- true
if changes made to records managed by this buffer can be undone;
false
if such changes are committed immediately, such that they cannot
be undone.public static <T extends Temporary> T lookupTempTable(java.lang.String name, java.lang.Class<T> expected) throws ErrorConditionException
T
- Variable type.name
- The temp table buffer name.expected
- The expected DMO type of the resolved temp-table.null
if not found.ErrorConditionException
- When the temp-table cannot be found or it does not match the master.public static <T> T addFrame(java.lang.String name, T frame)
ScopeLevel.NEXT
scope.
The instance will be placed in the list of deferred instances that will be added the next time a scope is opened.
name
- The frame name.frame
- The frame reference.null
if
there were no such instance. If there is a previous instance,
it will be replaced with this new instance.public static <T> T addFrame(ScopeLevel scope, java.lang.String name, T frame)
If the next scope is specified, the instance will be placed in the list of deferred instances that will be added the next time a scope is opened.
If global is specified, the instance will be added to the next scope on the stack, as there is no such thing as a global frame in the Progress 4GL.
If current is specified, the instance will be added to the scope that is on the top of the stack. If there is only one scope on the stack, the global and current scope will be the same scope.
T
- Frame type.scope
- Specifies the target scope.name
- The frame name.frame
- The frame reference.null
if
there were no such instance. If there is a previous instance,
it will be replaced with this new instance.public static <T> void addMenu(java.lang.String name, T menu)
ScopeLevel.NEXT
scope.
The instance will be placed in the list of deferred instances that will be added the next time a scope is opened.
name
- The menu name.menu
- The menu definition reference.public static <T> void addMenu(ScopeLevel scope, java.lang.String name, T menu)
If the next scope is specified, the instance will be placed in the list of deferred instances that will be added the next time a scope is opened.
If global is specified, the instance will be added to the next scope on the stack, as GLOBAL is not a valid option for shared menus.
If current is specified, the instance will be added to the scope that is on the top of the stack. If there is only one scope on the stack, the global and current scope will be the same scope.
T
- Menu definition type.scope
- Specifies the target scope.name
- The menu name.menu
- The menu reference.public static <T> T lookupFrame(java.lang.String name) throws ErrorConditionException
T
- Frame type.name
- The frame name.null
if not found.ErrorConditionException
- When the frame cannot be found and silent error mode is disabled.public static <T> T lookupMenu(java.lang.String name) throws ErrorConditionException
T
- menu definition type.name
- The menu name.null
if not found.ErrorConditionException
- When the menu cannot be found and silent error mode is disabled.public Scopeable createScopeable()
Scopeable
.createScopeable
in interface ScopeableFactory
public void scopeStart()
scopeStart
in interface Scopeable
public void scopeFinished()
This is a no-op for the shared variable manager.
scopeFinished
in interface Scopeable
public void scopeDeleted()
scopeDeleted
in interface Scopeable
public static void cleanupBuffer(BufferReference buffer)
SharedVariableManager.WorkArea.bufferCreator
for the specific buffer instance.buffer
- The buffer instance.static <T extends BaseDataType> void updateExtentVar(T[] array, T[] copy)
array
- The previous instance.copy
- The resized instance.static void cleanupPending()
private static void addWorker(SharedVariableManager.SharedRegistry sr, ScopeLevel scope, java.lang.String name, java.lang.Object var)
ScopeLevel.NEXT
request, otherwise the instance will be mapped into the current
or global scope immediately.sr
- The SharedVariableManager.SharedRegistry
container where to add the var.scope
- The scope to target.name
- The symbolic name for the shared instance.var
- The instance to be shared.private static java.lang.Object lookupWorker(SharedVariableManager.SharedRegistry sr, java.lang.String name, java.lang.Runnable error) throws ErrorConditionException
sr
- The SharedVariableManager.SharedRegistry
container where to add the var.name
- The symbolic name for the shared instance.error
- If no instance is found, use this to construct and throw the ERROR condition.ErrorConditionException
private static java.lang.Object lookupWorker(SharedVariableManager.PersistentShares<?> pshare, java.lang.String name, java.lang.Runnable error)
pshare
- The SharedVariableManager.PersistentShares
container where to add the object.name
- The symbolic name for the shared instance.error
- If no instance is found, use this to construct and throw the ERROR condition.private static void errorHelper(int num, java.lang.String msg) throws ErrorConditionException
ErrorConditionException
and throw it, when needed.num
- The error number.msg
- The error message.ErrorConditionException
- Always, this will be caught by ControlFlowOps and decide to log or re-throw
the error.private static void checkSharedTempTable(java.lang.Object found, java.lang.String name, java.lang.Class<? extends Temporary> expected)
found
- The found master temp-table.name
- The shared temp-table name.expected
- The expected temp-table to be defined by the found master.private static void checkSharedVariable(java.lang.String name, java.lang.Object var, boolean noUndo)
name
- The shared variables name.var
- The shared var instance (which is attempting to be defined).noUndo
- true
if this variable has its NO-UNDO option set.private static boolean variablesMatch(java.lang.String name, java.lang.Object var, boolean noUndo)
name
- The shared var name.var
- The slave variable which needs to match the master one.noUndo
- Flag indicating if the slave var was defined as NO-UNDO.private static boolean checkSharedResource(java.util.function.BooleanSupplier pred, java.lang.Runnable error)
true
. If it is not, it will execute
the specified error code.pred
- The predicate to evaluate if the resource matches the found master.error
- The error code to execute.true
if the resource matches the master.