SessionDriverRegistry class

Registry responsible for managing session driver registrations.

Third-party packages can use register and unregister to expose their own drivers at runtime. The class is a thin singleton wrapper around a map, deliberately avoiding any global state beyond the registry itself.

Properties

entries Map<String, SessionDriverRegistration>
Provides direct access to the internal map of entries.
no setterinherited
entryNames Iterable<String>
An iterable of all entry names in the registry.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

availableDrivers({Iterable<String> include = const []}) List<String>
Returns a sorted list of available driver names, ensuring that include is always present in the result.
buildDocContext(String driver, {required String pathBase}) SessionDriverDocContext
Builds a documentation context for driver rooted at pathBase.
builderFor(String driver) SessionDriverBuilder?
Retrieves the builder associated with driver or null when absent.
clearEntries() → void
Clears all entries from the registry.
inherited
contains(String driver) bool
Returns true if a registration exists for driver.
containsEntry(String name) bool
Checks if an entry with the given name exists in the registry.
inherited
createRegistration(SessionDriverBuilder builder, {DriverDocBuilder<SessionDriverDocContext>? documentation, SessionDriverValidator? validator, List<String> requiresConfig = const []}) SessionDriverRegistration
Creates a registration object for the given driver builder.
documentation({required String pathBase}) List<ConfigDocEntry>
Collates documentation from all registered drivers.
documentationFor(String driver, {required String pathBase}) List<ConfigDocEntry>
Collects documentation for a single driver, if provided.
inherited
driverNames({Iterable<String> include = const []}) Iterable<String>
Lists every driver name plus optional include identifiers.
inherited
duplicateDiagnostics(String name) String
Generates diagnostic information for duplicate entries with the given name.
inherited
ensureRequirements(String driver, SessionDriverBuilderContext context, SessionDriverRegistration registration) → void
entryOrigin(String name) StackTrace?
Retrieves the stack trace of the original registration for the given name.
inherited
getEntry(String name) SessionDriverRegistration?
Retrieves the entry associated with the given name.
inherited
hasDriver(String name) bool
Whether a driver named name exists in the registry.
inherited
normalizeName(String name) String
Normalizes the given name by trimming and converting it to lowercase.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDuplicate(String name, SessionDriverRegistration existing, bool overrideExisting) bool
Handles duplicate entries with the given name and existing value.
register(String driver, SessionDriverBuilder builder, {SessionDriverDocBuilder? documentation, bool overrideExisting = true, SessionDriverValidator? validator, List<String> requiresConfig = const []}) → void
Registers a new session driver.
registerDriver(String name, SessionDriverBuilder builder, {DriverDocBuilder<SessionDriverDocContext>? documentation, SessionDriverValidator? validator, List<String> requiresConfig = const [], bool overrideExisting = true}) bool
Registers builder under name, optionally attaching docs and validators.
inherited
registerDriverIfAbsent(String name, SessionDriverBuilder builder, {DriverDocBuilder<SessionDriverDocContext>? documentation, SessionDriverValidator? validator, List<String> requiresConfig = const []}) bool
Registers builder only when no existing driver uses name.
inherited
registerEntry(String name, SessionDriverRegistration value, {bool overrideExisting = true}) bool
Registers an entry with the given name and value.
inherited
registrationFor(String name) SessionDriverRegistration?
Resolves the registration for name, or null when absent.
inherited
runValidator(String driver, SessionDriverBuilderContext context, SessionDriverRegistration registration) → void
toString() String
A string representation of this object.
inherited
unregister(String driver) → void
Removes the registration associated with driver if it exists.
unregisterDriver(String name) → void
Removes the driver registered under name, if any.
inherited
unregisterEntry(String name) bool
Unregisters the entry with the given name.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance SessionDriverRegistry
Singleton accessor.
final