Class DefaultInjector

  • All Implemented Interfaces:
    Injector

    public class DefaultInjector
    extends Object
    implements Injector
    A default Cayenne implementations of a DI injector.
    Since:
    3.1
    • Method Detail

      • injectMembers

        public void injectMembers​(Object object)
        Description copied from interface: Injector
        Performs field injection on a given object, ignoring constructor injection. Since Cayenne DI injector returns fully injected objects, this method is rarely used directly.

        Note that using this method inside a custom DI Provider will most likely result in double injection, as custom provider is wrapped in a field-injecting provider by the DI container. Instead custom providers must initialize object properties manually, obtaining dependencies from Injector.

        Specified by:
        injectMembers in interface Injector
      • shutdown

        public void shutdown()
        Description copied from interface: Injector
        A lifecycle method that let's the injector's services to clean up their state and release resources. This method would normally generate a scope end event for the injector's one and only singleton scope.
        Specified by:
        shutdown in interface Injector