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.
get_service
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 );
Calls initialize on all service instances and sets their initialized property to true.
initialize
initialized
$sm->load_configuration;
Calls load_configuration on all service instances.
load_configuration
$sm->maybe_call_method( $method, @args );
Calls method $method on all active services that provide it, passing @args as arguments.
$method
@args
$sm->finalize( $wxebug );
Calls save_configuration on all service instances, then calls finalize on them and sets their finalized property to true.
save_configuration
finalize
finalized
Important: the 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 load_configuration.
undef
inititialize
Devel::ebug::Wx::Service::Base
To install Devel::ebug::Wx, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::ebug::Wx
CPAN shell
perl -MCPAN -e shell install Devel::ebug::Wx
For more information on module installation, please visit the detailed CPAN module installation guide.