const mixinafIoc::RegistryShutdown
afIoc::RegistryShutdown : afIoc::RegistryShutdownHub
(Service) - Contribute functions to be executed on Registry shutdown. All functions need to be immutable, which essentially means they can only reference const
classes. Example usage:
class AppModule { @Contribute { serviceType=RegistryShutdown# } static Void contributeRegistryShutdown(OrderedConfig conf, MyService myService) { conf.add |->| { myService.shutdown() } } }
If the shutdown method of your service depends on other services being available, add a constraint on afIoc.shutdown
:
conf.addOrdered("MyServiceShutdown", |->| { myService.shutdown() }, ["BEFORE: afIoc.shutdown"])
Note that Errs thrown by shutdown functions will be logged and then swallowed.
@uses OrderedConfig of |->|