Jet\Application_Service_List
The base class that manages services within the application services subsystem.
The class handles routine management of the service list, loading configuration, list administration, and retrieving instances of the services themselves. It is not a final class intended to be used on its own. Other classes (such as JetApplication\Application_Service_Admin) always inherit from this class within an application to provide the final service management for the application – or a specific part of it.
| Method | Meaning |
|---|---|
| public __construct( string $cfg_file_path, string $group ) |
Parameters:
|
| public getServicesMetaInfo( ) : [string=>Application_Service_MetaInfo] |
Returns the prepared list of service metadata. |
| public loadCfg( ) : void |
Loads the configuration file. |
| public saveCfg( ) : void |
Saves the configuration file. |
| public getConfig( ) : array |
Loads the configuration and returns raw configuration data. |
| public setServiceConfig( string $interface_class_name, string|array $module_class_name ) : void |
Sets configuration for a specific service. Assigns a specific application module (or modules) to a specific interface. |
| public getServiceMetaInfo( string $interface_class_name ) : null|Application_Service_MetaInfo |
Returns metadata of an application service based on the interface (or abstract class) name. If no module in the application provides the service, it either returns null when the service is not mandatory, or throws an exception regarding a missing mandatory service, terminating execution. |
| public get( string $interface_class_name ) : null|Application_Module |
Returns an instance of the application module that provides the given service. If no module in the application provides the service, it either returns null when the service is not mandatory, or throws an exception regarding a missing mandatory service, terminating execution. |
| public getList( string $interface_class_name ) : [Application_Module] |
Returns instances of application modules that provide the given service. If no module in the application provides the service, it either returns an empty array when the service is not mandatory, or throws an exception regarding a missing mandatory service, terminating execution. |
| public static findPossibleModules( string $interface_class_name, ?string $name_prefix=null ) : [Application_Module] |
Finds all application modules in the system that could provide the given service and returns their instances. Useful, for example, when building configuration tools. |
| public static getServiceMetaInfos( ) : [Application_Service_MetaInfo] |
Finds all possible application services in the application and returns a list of them – or rather returns a list of metadata for these services. |