line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
############################################################################### |
2
|
|
|
|
|
|
|
# Purpose : Cache Storage Policy Factory. |
3
|
|
|
|
|
|
|
# Author : Sam Graham |
4
|
|
|
|
|
|
|
# Created : 23 Jun 2008 |
5
|
|
|
|
|
|
|
# CVS : $Id: Storage.pm,v 1.9 2010-02-16 12:25:41 illusori Exp $ |
6
|
|
|
|
|
|
|
############################################################################### |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package Cache::CacheFactory::Storage; |
9
|
|
|
|
|
|
|
|
10
|
10
|
|
|
10
|
|
55
|
use warnings; |
|
10
|
|
|
|
|
17
|
|
|
10
|
|
|
|
|
270
|
|
11
|
10
|
|
|
10
|
|
47
|
use strict; |
|
10
|
|
|
|
|
15
|
|
|
10
|
|
|
|
|
255
|
|
12
|
|
|
|
|
|
|
|
13
|
10
|
|
|
10
|
|
9805
|
use Class::Factory; |
|
10
|
|
|
|
|
25978
|
|
|
10
|
|
|
|
|
355
|
|
14
|
|
|
|
|
|
|
|
15
|
10
|
|
|
10
|
|
95
|
use base qw/Class::Factory/; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
2048
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$Cache::CacheFactory::Storage::VERSION = '1.10'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new |
20
|
|
|
|
|
|
|
{ |
21
|
11
|
|
|
11
|
1
|
32
|
my ( $this, $type, @params ) = @_; |
22
|
11
|
|
|
|
|
18
|
my ( $class ); |
23
|
|
|
|
|
|
|
|
24
|
11
|
|
|
|
|
118
|
$class = $this->get_factory_class( $type ); |
25
|
11
|
50
|
|
|
|
1148
|
return( undef ) unless $class; |
26
|
11
|
|
|
|
|
50
|
return( $class->new( @params ) ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__PACKAGE__->register_factory_type( |
30
|
|
|
|
|
|
|
memory => 'Cache::MemoryCache' ); |
31
|
|
|
|
|
|
|
__PACKAGE__->register_factory_type( |
32
|
|
|
|
|
|
|
sharedmemory => 'Cache::SharedMemoryCache' ); |
33
|
|
|
|
|
|
|
__PACKAGE__->register_factory_type( |
34
|
|
|
|
|
|
|
file => 'Cache::FileCache' ); |
35
|
|
|
|
|
|
|
__PACKAGE__->register_factory_type( |
36
|
|
|
|
|
|
|
null => 'Cache::NullCache' ); |
37
|
|
|
|
|
|
|
__PACKAGE__->register_factory_type( |
38
|
|
|
|
|
|
|
fastmemory => 'Cache::FastMemoryCache' ); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |