Overview
Methods
get()
Get a DEFAULT-scoped (singleton) provider.getScoped()
Get a provider from given views (for session/request scoped providers).resolve()
Lightweight synchronous resolver for app-scoped DI.resolveBootstrapDep()
Resolve a dependency usable during bootstrap phase.getProviders()
Get all provider entries.buildViews()
Build provider views for different scopes.addRegistry()
Add a registry by type.getRegistries()
Get registries by type.getHooksRegistry()
Get the hooks registry.getScopeRegistry()
Get the scope registry.mergeFromRegistry()
Merge providers from another registry.getProviderInfo()
Get exported provider definitions.injectProvider()
Inject a provider value directly.addDynamicProviders()
Add providers dynamically at runtime.Session Management
cleanupSession()
Clean up a specific session’s provider cache.cleanupExpiredSessions()
Clean up expired sessions from cache.startSessionCleanup()
Start background session cleanup timer.stopSessionCleanup()
Stop background session cleanup timer.getSessionCacheStats()
Get session cache statistics.isSessionCacheEnabled()
Check if session caching is enabled.dispose()
Dispose registry and clean up all resources.Server/Scope Access
getActiveScope()
Get the active scope.getActiveServer()
Get the active server.Provider Scopes
FrontMCP supports multiple provider scopes:| Scope | Description | Lifecycle |
|---|---|---|
SINGLETON | Shared across all requests | Server lifetime |
SESSION | Per-session instance | Session lifetime |
REQUEST | Per-request instance | Request lifetime |
CONTEXT | Per-execution context | Context lifetime |
In distributed/serverless mode,
SESSION is normalized to CONTEXT to avoid stale instances.Provider Views
Provider views represent the hierarchy of available providers:Indexes
| Index | Key | Description |
|---|---|---|
providedBy | Token | Which registry provided each token |
order | number | Topological order for instantiation |
registries | RegistryType | Map of registries by kind |