getSingleton abstract method
Retrieve the pod registered under name
.
This method returns the pod associated with the given name.
The exact behavior and returned type depend on the registry
implementation and the generic type T
.
name
: The name of the pod to retrieve
Returns the pod object of type T
associated with the name
Throws:
IllegalArgumentException
if name is null or emptyPodNotFoundException
if no pod exists with the given name
Example:
// Get a singleton instance
final instance = singletonRegistry.getSingleton('userService');
instance.processRequest();
Implementation
Future<Object?> getSingleton(String name, {bool allowEarlyReference = true, ObjectFactory<Object>? factory});