P5EEx-Blue-0.01

P5EEx::Blue::Service


NAME

P5EEx::Blue::Service - Provides core methods for P5EE Services


SYNOPSIS

    use P5EEx::Blue::Service;
    # never really used, because this is a base class
    %named = (
        # named args would go here
    );
    $service = P5EEx::Blue::Service->new(%named);


DESCRIPTION

The P5EEx::Blue::Service class is a base class for all P5EE services.

    * Throws: P5EEx::Blue::Exception
    * Since:  0.01


Constructor Methods:

new()

This constructor is used to create all objects which are P5EE services. Customized behavior for a particular service is achieved by overriding the init() method.

    * Signature: $service = P5EEx::Blue::Service->new(%named)
    * Return:    $service       P5EEx::Blue::Service
    * Throws:    P5EEx::Blue::Exception
    * Since:     0.01
    Sample Usage: (never used because this is a base class, but the
    constructors of all services follow these rules)

    * If the number of arguments is odd, the first arg is the service name
      (otherwise, "default" is assumed)
    * If there are remaining arguments, they are variable/value pairs
    * If there are no arguments at all, the "default" name is assumed
    * If a "name" was supplied using any of these methods,
      the master config is consulted to find the config for this
      particular service instance (service_type/name).
    $service = P5EEx::Blue::Service->new();        # assumes "default" name
    $service = P5EEx::Blue::Service->new("srv1");  # instantiate named service
    $service = P5EEx::Blue::Service->new(          # "default" with named args
        arg1 => 'value1',
        arg2 => 'value2',
    );

service_type()

Returns the service type (i.e. Repository, Procedure, Widget, etc.).

    * Signature: $service_type = P5EEx::Blue::Service->service_type();
    * Param:     void
    * Return:    $service_type  string
    * Since:     0.01
    $service_type = $widget->service_type();


Protected Methods:

The following methods are intended to be called by subclasses of the current class.

init()

The init() method is called from within the standard Service constructor. It allows subclasses of the Service to customize the behavior of the constructor by overriding the init() method. The init() method in this class simply calls the init() method to allow each service instance to initialize itself.

    * Signature: init($named)
    * Param:     $named      {}   [in]
    * Return:    void
    * Throws:    P5EEx::Blue::Exception
    * Since:     0.01
    Sample Usage:
    $service->init(\%args);


ACKNOWLEDGEMENTS

 * Author:  Stephen Adkins <stephen.adkins@officevision.com>
 * License: This is free software. It is licensed under the same terms as Perl itself.


SEE ALSO

P5EEx::Blue::P5EE, P5EEx::Blue::Context, P5EEx::Blue::Config