# preparePodFactory method

1. @override

Future<void> preparePodFactory()
override

Prepares the ConfigurableListablePodFactory for this context.

Subclasses typically register default pods, configure singleton pods, or set up dependency wiring at this stage.

Example:

    @override
    Future<void> preparePodFactory(ConfigurableListablePodFactory factory) async {
    factory.registerSingleton('myService', object: ObjectHolder(MyService()));
    }

This is part of Jetleaf – a framework which developers can use to build web applications.

## Implementation

    @override
    Future<void> preparePodFactory() async {
      _reader = AnnotatedPodDefinitionReader();
      _reader.setEnvironment(getEnvironment());
      _reader.setPodFactory(getPodFactory());

      setAllowDefinitionOverriding(false);
      setAllowCircularReferences(true);

      return await _reader.doRegister(getMainApplicationClass());
    }