Class LoaderRegistry
Registry for data loaders with auto-discovery. Discovers loaders via reflection and executes them in priority order.
Usage:
- Create registry instance
- Call DiscoverLoaders() with assemblies to scan
- Call ExecuteAll() to run loaders in priority order
public class LoaderRegistry
- Inheritance
-
objectLoaderRegistry
Constructors
LoaderRegistry(string)
Create a loader registry.
public LoaderRegistry(string logSubsystem = "core_data_loading")
Parameters
logSubsystemstringSubsystem name for logging
Properties
Count
Get count of registered loaders.
public int Count { get; }
Property Value
- int
Methods
DiscoverLoaders(params Assembly[])
Auto-discover and register all loader factories in specified assemblies.
public void DiscoverLoaders(params Assembly[] assemblies)
Parameters
assembliesAssembly[]Assemblies to scan for ILoaderFactory implementations
ExecuteAll(LoaderContext)
Execute all registered loaders in priority order.
public bool ExecuteAll(LoaderContext context)
Parameters
contextLoaderContextLoading context with registries and settings
Returns
- bool
True if all required loaders succeeded
GetAllLoaders()
Get all registered loaders in priority order.
public IEnumerable<LoaderRegistry.LoaderRegistration> GetAllLoaders()
Returns
- IEnumerable<LoaderRegistry.LoaderRegistration>
GetLoadingSummary()
Get loading summary.
public string GetLoadingSummary()
Returns
- string
RegisterFactory(ILoaderFactory, LoaderMetadataAttribute)
Manually register a loader factory instance with metadata.
public bool RegisterFactory(ILoaderFactory factory, LoaderMetadataAttribute metadata)
Parameters
factoryILoaderFactorymetadataLoaderMetadataAttribute
Returns
- bool
RegisterFactory(Type)
Manually register a loader factory type.
public bool RegisterFactory(Type factoryType)
Parameters
factoryTypeType
Returns
- bool
TryGetLoader(string, out LoaderRegistration)
Try to get loader registration by name.
public bool TryGetLoader(string name, out LoaderRegistry.LoaderRegistration registration)
Parameters
namestringregistrationLoaderRegistry.LoaderRegistration
Returns
- bool