|
NAMEZonemaster::Backend::Config::DCPlugin - Daemon::Control plugin that loads the backend configuration. SYNOPSISProvides validated and sanity-checked backend configuration through the config, db and pm properties. my $daemon = Daemon::Control
->with_plugins('+Zonemaster::Backend::Config::DCPlugin')
->new({
program => sub {
my $self = shift;
$self->init_backend_config();
my $config = $self->config;
my $db = $self->db;
my $pm = $self->pm;
...
},
});
No configuration is loaded automatically. Instead a successful call to init_backend_config() is required. On restart the reload_config() method is called automatically. AUTHORMattias P, "<mattias.paivarinta@iis.se>" INSTANCE METHODSinit_backend_configInitializes or reinitializes the config, db and pm properties. A candidate for the config property is either accepted as an argument, or Zonemaster::Backend::Config::load_config is invoked to provide one. Candidates for the db and pm properties are constructed according to the config candidate. Returns 1 if all candidates are successfully constructed. In this case all properties are assigned their respective candidate values. Returns 0 if the construction of any one of the candidates fails. Details about the construction failure are logged. None of the properties are updated. PROPERTIESconfigGetter for the currently loaded configuration. Throws an exception if no successful call to init_backend_config() has been made prior to this call. dbGetter for a database adapter constructed according to the current configuration. Throws an exception if no successful call to init_backend_config() has been made prior to this call. pmGetter for a processing manager constructed according to the current configuration. Throws an exception if no successful call to init_backend_config() has been made prior to this call.
|