Devel::ebug::Wx::Service::ServiceManager - manage services
my $sm = $wxebug->service_manager; # or find it elsewhere my $service = $sm->get_service( $service_name ); # use the $service # alternate ways of getting a service my $srv = $wxebug->service_manager->get_service( 'foo_frobnicate' ); my $srv = $wxebug->foo_frobnicate_service;
The service manager is responsible for finding, initializing and terminating services. Users of the service usually need just to call
get_service to retrieve a service instance.
my @service_classes = Devel::ebug::Wx::ServiceManager->services;
Returns a list of service classes known to the service manager.
my @services = $sm->active_services;
Returns a list of services currently registered with the service manager.
$sm->initialze( $wxebug );
initialize on all service instances and sets their
initialized property to true.
load_configuration on all service instances.
$sm->maybe_call_method( $method, @args );
$method on all active services that provide it, passing
@args as arguments.
$sm->finalize( $wxebug );
save_configuration on all service instances, then calls
finalize on them and sets their
finalized property to true.
initialized property is still true even after
finalize has been called..
my $service_instance = $sm->get_service( 'service_name' );
Returns an active service with the given name, or
undef if none is found. If the service has not been initialized, calls
inititialize as well, but not