| Cache-CacheFactory documentation | Contained in the Cache-CacheFactory distribution. |
Cache::CacheFactory::Expiry - Factory class for expiry policies for Cache::CacheFactory.
Cache::CacheFactory::Expiry is a class factory for expiry (pruning and validity) policies used by Cache::CacheFactory.
You will only need to know about this module if you're writing your own expiry policy modules, documented in "WRITING NEW POLICIES" in Cache::CacheFactory.
Construct an expiry policy of the specified type, supplying @param
to the constructor of the policy object.
Original author: Sam Graham <libcache-cachefactory-perl BLAHBLAH illusori.co.uk>
Last author: $Author: illusori $
Copyright 2008-2010 Sam Graham.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Cache-CacheFactory documentation | Contained in the Cache-CacheFactory distribution. |
############################################################################### # Purpose : Cache Expiry Policy Factory. # Author : Sam Graham # Created : 23 Jun 2008 # CVS : $Id: Expiry.pm,v 1.8 2010-02-16 12:25:41 illusori Exp $ ############################################################################### package Cache::CacheFactory::Expiry; use warnings; use strict; use Class::Factory; use base qw/Class::Factory/; $Cache::CacheFactory::Expiry::VERSION = '1.10'; sub new { my ( $this, $type, @params ) = @_; my ( $class ); $class = $this->get_factory_class( $type ); return( undef ) unless $class; return( $class->new( @params ) ); } __PACKAGE__->register_factory_type( forever => 'Cache::CacheFactory::Expiry::Base' ); __PACKAGE__->register_factory_type( time => 'Cache::CacheFactory::Expiry::Time' ); __PACKAGE__->register_factory_type( size => 'Cache::CacheFactory::Expiry::Size' ); __PACKAGE__->register_factory_type( lastmodified => 'Cache::CacheFactory::Expiry::LastModified' ); 1; __END__