NAME

Hyper::Singleton - base class which implements the singleton design pattern

VERSION

This document describes Hyper::Singleton 0.01

SYNOPSIS

package Hyper::Singleton::Sample;

use Class::Std::Storable;
use base qw(Hyper::Singleton);

1;

my $instance_1 = Hyper::Singleton::Sample->singleton();
my $instance_2 = Hyper::Singleton::Sample->singleton();

ref $instance_1 eq ref $instance_2;

DESCRIPTION

Hyper::Singleton gives the inheriting class the singleton method, which is used to get only one object of this class on every call.

SUBROUTINES/METHODS

BUILD

my $new_instance = Hyper::Singleton::Debug->new();

Create a new Object instance.

singleton

my $instance = Hyper::Singleton::Sample->singleton();

Get the object as singleton.

_init_singleton :PRIVATE

$self->_init_singleton();

Initializes the singleton and stores it to our global vars.

_get_singleton :PRIVATE

my $existant_instance = $self->_get_singleton();

Get existant instance of the singleton object.

_get_request_object :PRIVATE

my $r = $self->_get_request_object();

Get the apache request object in mod perl environments.

_get_identifier :PRIVATE

my $identifier = $self->_get_identifier();

Get the apache request object in mod perl environments.

STORABLE_thaw_post :CUMULATIVE

Reinitialize our object on thaw.

DIAGNOSTICS

CONFIGURATION AND ENVIRONMENT

DEPENDENCIES

  • version

  • Class::Std::Storable

  • Apache2::RequestUtil

  • Apache::RequestUtil

INCOMPATIBILITIES

BUGS AND LIMITATIONS

RCS INFORMATIONS

Last changed by

$Author: $

Id

$Id: $

Revision

$Revision: $

Date

$Date: $

HeadURL

$HeadURL: $

AUTHOR

Andreas Specht <ACID@cpan.org>

LICENSE AND COPYRIGHT

Copyright (c) 2007, Andreas Specht <ACID@cpan.org>. All rights reserved.

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