GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Bread::Board::Service(3) User Contributed Perl Documentation Bread::Board::Service(3)

Bread::Board::Service - Base service role

version 0.37

This role is the basis for all services in Bread::Board. It provides (or requires the implementation of) the minimum necessary building blocks: creating an instance, setting/getting parameters, instance lifecycle.

Read/write string, required. Every service needs a name, by which it can be referenced when fetching it.

Boolean, defaults to false. Used during dependency resolution to detect loops.

  $service->lifecycle('Singleton');

Read/write string; it should be either a partial class name under the "Bread::Board::LifeCycle::" namespace (like "Singleton" for "Bread::Board::LifeCycle::Singleton") or a full class name prefixed with "+" (like "+My::Special::Lifecycle"). The name is expected to refer to a loadable role, which will be applied to the service instance.

Locks the service; you should never need to call this method in normal code.

Unlocks the service; you should never need to call this method in normal code.

  my $value = $service->get();

This method must be implemented by the consuming class. It's expected to instantiate whatever object or value this service should resolve to.

Builder for the service parameters, defaults to returning an empty hashref.

Clearer of the service parameters.

  my @param_names = $service->param();
  my $param_value = $service->param($param_name);
  $service->param($name1=>$value1,$name2=>$value2);

Getter/setter for the service parameters; notice that calling this method with no arguments returns the list of parameter names.

Please note: these are not the same as the parameters for a parametric service (although those will be copied here before "get" is called), nor are they the same thing as dependencies (although the resolved dependencies will be copied here before "get" is called).

When declaring a service using the "service" helper function, if the name you use starts with a '+', the service definition will extend an existing service with the given name (without the '+'). This method implements the extension semantics: the "dependencies" and "parameters" options will be merged with the existing values, rather than overridden.

Stevan Little <stevan@iinteractive.com>

Please report any bugs or feature requests on the bugtracker website https://github.com/stevan/BreadBoard/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2019-06-28 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.