getRegistry method

Retrieves the registry associated with this type.

Throws SubsystemNotFoundException if no registry has been created yet.

Implementation

SubsystemInstanceRegistryByTypeDesc getRegistry() {
  final registry = SubsystemInstanceRegistry.findRegistryForTypeId(serviceTypeId);
  if (registry == null) {
    throw SubsystemNotFoundException(
      'No registry found for type ID: $serviceTypeId',
      typeId: serviceTypeId,
    );
  }
  return registry;
}