#include <PackageManager.hpp>
Protected Types | |
enum | { IMAGE_PACKAGES = 1 , IMAGE_PACKAGE_ROUTINES , IMAGE_REGISTERED_ROUTINES , IMAGE_REQUIRES , IMAGE_ARRAY_SIZE = IMAGE_REQUIRES } |
Static Protected Member Functions | |
static RoutineClass * | checkRequiresCache (RexxString *name, ProtectedObject &result) |
Static Protected Attributes | |
static RexxDirectory * | imagePackages = OREF_NULL |
static RexxDirectory * | imagePackageRoutines = OREF_NULL |
static RexxDirectory * | imageRegisteredRoutines = OREF_NULL |
static RexxDirectory * | imageLoadedRequires = OREF_NULL |
static RexxDirectory * | packages = OREF_NULL |
static RexxDirectory * | packageRoutines = OREF_NULL |
static RexxDirectory * | registeredRoutines = OREF_NULL |
static RexxDirectory * | loadedRequires = OREF_NULL |
static RexxPackageEntry * | rexxPackage = &rexx_package_entry |
Definition at line 59 of file PackageManager.hpp.
|
protected |
Enumerator | |
---|---|
IMAGE_PACKAGES | |
IMAGE_PACKAGE_ROUTINES | |
IMAGE_REGISTERED_ROUTINES | |
IMAGE_REQUIRES | |
IMAGE_ARRAY_SIZE |
Definition at line 102 of file PackageManager.hpp.
|
static |
Add a function to the package-defined functions table.
name | The name of the function. |
func |
Definition at line 505 of file PackageManager.cpp.
References packageRoutines, and RexxDirectory::put().
Referenced by LibraryPackage::loadRoutines().
|
static |
Process the basics of RxFuncAdd(). This will return 0 if the function can be resolved and is callable, 1 otherwise. If the target function is not in a loadable package file, this will also do the global registration.
name | The name of the registered function. |
module | The name of the library containing the function. |
proc | The target procedure name (ignored if the target library is a self-loading one). |
Definition at line 529 of file PackageManager.cpp.
References getLoadedRoutine(), OREF_NULL, resolveRoutine(), TheFalseObject, TheTrueObject, and RexxString::upper().
Referenced by BUILTIN().
|
static |
Attempt to call a native code function. This will call either new-style package functions or old-style registered functions.
activity | The activity we're running under. |
name | The target name of the routine. |
arguments | The function arguments. |
argcount | The argument count. |
result | The return result. |
Definition at line 657 of file PackageManager.cpp.
References RexxDirectory::at(), OREF_NULL, packageRoutines, resolveRoutine(), and RexxString::upper().
Referenced by SystemInterpreter::invokeExternalFunction().
|
staticprotected |
Check for a package already in the requires cache.
name | The name of the target. |
Definition at line 900 of file PackageManager.cpp.
References WeakReference::get(), RexxHashTableCollection::get(), loadedRequires, OREF_NULL, and RexxDirectory::remove().
Referenced by loadRequires().
|
static |
Create a new registered function entry and add to the function cache.
function |
Definition at line 427 of file PackageManager.cpp.
References OREF_NULL, RexxDirectory::put(), registeredRoutines, and RexxResolveRoutine().
Referenced by resolveRoutine().
|
static |
Drop a registered function.
name | Name of the registered function. |
Definition at line 567 of file PackageManager.cpp.
References RexxString::getStringData(), registeredRoutines, RexxDirectory::remove(), RexxDeregisterFunction(), TheFalseObject, TheTrueObject, and RexxString::upper().
Referenced by BUILTIN().
|
static |
Return the information that needs to be saved in the saved image.
Definition at line 93 of file PackageManager.cpp.
References IMAGE_ARRAY_SIZE, IMAGE_PACKAGE_ROUTINES, IMAGE_PACKAGES, IMAGE_REGISTERED_ROUTINES, IMAGE_REQUIRES, loadedRequires, new_array(), packageRoutines, packages, RexxArray::put(), and registeredRoutines.
Referenced by RexxMemory::saveImage().
|
static |
Resolve a named package, dynamically loading the package if not already in the table.
name | The name of the library associated with this package. |
Definition at line 185 of file PackageManager.cpp.
References Error_Execution_library, and reportException().
Referenced by RexxActivation::loadLibrary(), and InterpreterInstance::processOptions().
|
static |
Locate an already loaded function.
function | The function name. |
Definition at line 403 of file PackageManager.cpp.
References RexxDirectory::at(), OREF_NULL, packageRoutines, and registeredRoutines.
Referenced by addRegisteredRoutine(), queryRegisteredRoutine(), and resolveRoutine().
|
static |
Retrieve a ::REQUIRES file from the macrospace.
activity | The current activity. |
name | The target name. |
result | The returned Routine object for the package. |
securityManager | A security manager to associated with the package. |
Definition at line 782 of file PackageManager.cpp.
References RexxActivity::checkRequires(), RexxActivation::getMacroCode(), loadedRequires, OREF_NULL, RexxDirectory::put(), and RoutineClass::setSecurityManager().
Referenced by loadRequires().
|
static |
Retrieve a file version of a ::REQUIRES file.
activity | The current activity. |
name | The fully resolved file name. |
result | The return routine object. |
Definition at line 814 of file PackageManager.cpp.
References RexxActivity::checkRequires(), RoutineClass::fromFile(), OREF_NULL, and RoutineClass::setSecurityManager().
Referenced by loadRequires().
|
static |
Initialize the package manager global state.
Definition at line 75 of file PackageManager.cpp.
References loadedRequires, loadInternalPackage(), loadLibrary(), new_directory(), packageRoutines, packages, registeredRoutines, and rexxPackage.
Referenced by RexxMemory::createImage().
|
static |
Normal live marking.
Definition at line 156 of file PackageManager.cpp.
References loadedRequires, memory_mark, packageRoutines, packages, and registeredRoutines.
Referenced by RexxMemory::live().
|
static |
Generalized live marking.
Definition at line 167 of file PackageManager.cpp.
References loadedRequires, memory_mark_general, packageRoutines, packages, and registeredRoutines.
Referenced by RexxMemory::liveGeneral().
|
static |
Load an internal package into our list. This does not load a library, but links package routines ones already contained inside the interpreter.
name | Name of the package...this is probably "REXX" or "REXXUTIL". |
p | The package descriptor with the method and function list. |
Definition at line 463 of file PackageManager.cpp.
References packages, and RexxDirectory::put().
Referenced by initialize(), and registerPackage().
|
static |
Attempt to load a library without raising an error. Returns a LibraryPackage object for the library if the load was successful.
name | The target library name. |
Definition at line 208 of file PackageManager.cpp.
References OREF_NULL, packages, RexxDirectory::put(), and RexxDirectory::remove().
Referenced by initialize(), and LoadLibraryPackage().
|
static |
Quietly create a Native method from a registered package.
packageName | The name of the package the library is loaded from. |
methodName | The name of the procedure to resolve from the package. |
Definition at line 263 of file PackageManager.cpp.
References OREF_NULL.
Referenced by RexxMethod::loadExternalMethod().
|
static |
Loade a requires file from an in-store source. NOTE: This is not cached like the other requires files
activity | The current activity. |
name | The fully resolved file name. |
result | The return routine object. |
Definition at line 841 of file PackageManager.cpp.
References checkRequiresCache(), loadedRequires, OREF_NULL, and RexxDirectory::put().
|
static |
Loade a requires file from an array source. NOTE: This is not cached like the other requires files
activity | The current activity. |
name | The fully resolved file name. |
result | The return routine object. |
Definition at line 873 of file PackageManager.cpp.
References checkRequiresCache(), loadedRequires, OREF_NULL, and RexxDirectory::put().
|
static |
Retrieve a ::REQUIRES file. This will cache the entries so that the same requires entry is returned for every request.
activity | The current activity. |
shortName | The short name of the package. |
resolvedName | The fully resolved name of a potential package file. The short name is used for checking in the MacroSpace, the long name is used for file searches. |
result | The return package routine. |
Definition at line 700 of file PackageManager.cpp.
References SecurityManager::checkRequiresAccess(), RexxActivity::getEffectiveSecurityManager(), getMacroSpaceRequires(), getRequiresFile(), RexxString::getStringData(), OREF_NULL, RexxQueryMacro(), and RXMACRO_SEARCH_BEFORE.
Referenced by InterpreterInstance::loadRequires().
|
static |
Quietly load a package function. This goes explicitly to a loaded package to resolve the name rather than relying on the global cache. This will resolve to the same routine object as the global cache, but this prevents us from picking one a different one in case of a name conflict.
packageName | The package name. |
function | The function name. |
Definition at line 379 of file PackageManager.cpp.
References OREF_NULL.
Referenced by RoutineClass::loadExternalRoutine().
|
static |
The query method backing RxFuncQuery(). This checks both our local tables and the global tables to see if something has been registered.
name | Target name. |
Definition at line 600 of file PackageManager.cpp.
References getLoadedRoutine(), RexxString::getStringData(), OREF_NULL, RexxQueryFunction(), TheFalseObject, TheTrueObject, and RexxString::upper().
Referenced by BUILTIN().
|
static |
Register an in-process library package.
name | The name to register under. |
p | The package table information. |
Definition at line 485 of file PackageManager.cpp.
References RexxDirectory::at(), loadInternalPackage(), OREF_NULL, and packages.
Referenced by InterpreterInstance::processOptions(), and RegisterLibrary().
|
static |
Create a Native method from a registered package.
packageName | The name of the package the library is loaded from. |
methodName | The name of the procedure to resolve from the package. |
Definition at line 241 of file PackageManager.cpp.
References LibraryPackage::resolveMethod().
Referenced by RexxSource::createNativeMethod().
|
static |
Resolve an entry point for a package method entry (used on a restore or reflatten);
name | Name of the target method. |
Definition at line 929 of file PackageManager.cpp.
References Error_Execution_library_method, and reportException().
Referenced by RexxNativeMethod::run().
|
static |
Resolve an entry point for a package function entry (used on a restore or reflatten);
name | Name of the target function. |
Definition at line 971 of file PackageManager.cpp.
References Error_Execution_library_routine, RexxString::getStringData(), OREF_NULL, reportException(), and RexxResolveRoutine().
Referenced by RegisteredRoutine::call().
|
static |
Resolve a registered function.
function | The function name. |
Definition at line 326 of file PackageManager.cpp.
References createRegisteredRoutine(), getLoadedRoutine(), and OREF_NULL.
|
static |
Resolve a package function activator.
function | The function name. |
package | The package/library name. |
procedure | Procedure name. Only used if directly loaded from a library file. |
Definition at line 291 of file PackageManager.cpp.
References RexxDirectory::at(), createRegisteredRoutine(), RexxString::getStringData(), OREF_NULL, registeredRoutines, and RexxRegisterFunctionDll().
Referenced by addRegisteredRoutine(), callNativeRoutine(), and RexxSource::routineDirective().
|
static |
Resolve a package function. This goes explicitly to a loaded package to resolve the name rather than relying on the global cache. This will resolve to the same routine object as the global cache, but this prevents us from picking one a different one in case of a name conflict.
packageName | The package name. |
function | The function name. |
Definition at line 355 of file PackageManager.cpp.
References LibraryPackage::resolveRoutine().
|
static |
Resolve an entry point for a package function entry (used on a restore or reflatten);
name | Name of the target function. |
Definition at line 950 of file PackageManager.cpp.
References Error_Execution_library_method, and reportException().
Referenced by RexxNativeRoutine::call().
|
static |
Restore the saved image data to operational status
Definition at line 125 of file PackageManager.cpp.
References RexxHashTableCollection::available(), RexxDirectory::copy(), RexxHashTableCollection::first(), imageLoadedRequires, imagePackageRoutines, imagePackages, imageRegisteredRoutines, loadedRequires, RexxHashTableCollection::next(), packageRoutines, packages, registeredRoutines, LibraryPackage::reload(), and rexxPackage.
Referenced by RexxMemory::restore(), and RexxMemory::restoreImage().
|
static |
Restore the saved image data.
imageArray | The array we placed in the save image originally. |
Definition at line 111 of file PackageManager.cpp.
References RexxArray::get(), IMAGE_PACKAGE_ROUTINES, IMAGE_PACKAGES, IMAGE_REGISTERED_ROUTINES, IMAGE_REQUIRES, imageLoadedRequires, imagePackageRoutines, imagePackages, and imageRegisteredRoutines.
|
static |
Unload all of the libraries loaded in this Rexx process.
Definition at line 625 of file PackageManager.cpp.
References RexxHashTableCollection::available(), RexxDirectory::copy(), RexxHashTableCollection::first(), imageLoadedRequires, imagePackageRoutines, imagePackages, imageRegisteredRoutines, loadedRequires, RexxHashTableCollection::next(), packageRoutines, packages, registeredRoutines, and LibraryPackage::unload().
Referenced by Interpreter::terminateInterpreter().
|
staticprotected |
Definition at line 114 of file PackageManager.hpp.
|
staticprotected |
Definition at line 112 of file PackageManager.hpp.
|
staticprotected |
Definition at line 111 of file PackageManager.hpp.
|
staticprotected |
Definition at line 113 of file PackageManager.hpp.
|
staticprotected |
Definition at line 120 of file PackageManager.hpp.
Referenced by checkRequiresCache(), getImageData(), getMacroSpaceRequires(), initialize(), live(), liveGeneral(), loadRequires(), restore(), and unload().
|
staticprotected |
Definition at line 118 of file PackageManager.hpp.
Referenced by addPackageRoutine(), callNativeRoutine(), getImageData(), getLoadedRoutine(), initialize(), live(), liveGeneral(), restore(), and unload().
|
staticprotected |
Definition at line 117 of file PackageManager.hpp.
Referenced by getImageData(), initialize(), live(), liveGeneral(), loadInternalPackage(), loadLibrary(), registerPackage(), restore(), and unload().
|
staticprotected |
Definition at line 119 of file PackageManager.hpp.
Referenced by createRegisteredRoutine(), dropRegisteredRoutine(), getImageData(), getLoadedRoutine(), initialize(), live(), liveGeneral(), resolveRoutine(), restore(), and unload().
|
staticprotected |
Definition at line 122 of file PackageManager.hpp.
Referenced by initialize(), and restore().