############################################################################### # Purpose : Cache Expiry Policy Factory. # Author : Sam Graham # Created : 23 Jun 2008 # CVS : $Id: Expiry.pm,v 1.5 2008-07-07 22:05:45 illusori Exp $ ############################################################################### package Cache::CacheFactory::Expiry; use warnings; use strict; use Class::Factory; use base qw/Class::Factory/; $Cache::CacheFactory::Expiry::VERSION = sprintf"%d.%03d", q$Revision: 1.5 $ =~ /: (\d+)\.(\d+)/; 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__ =pod =head1 NAME Cache::CacheFactory::Expiry - factory class for expiry policies for Cache::CacheFactory. =head1 DESCRIPTION L is a class factory for expiry (pruning and validity) policies used by L. You will only need to know about this module if you're writing your own expiry policy modules, documented in L. =head1 METHODS =over =item $policy = Cache::CacheFactory::Expiry->new( $type, @param ); Construct an expiry policy of the specified type, supplying C<@param> to the constructor of the policy object. =back =head1 SEE ALSO L, L =head1 AUTHORS Original author: Sam Graham Last author: $Author: illusori $ =head1 COPYRIGHT Copyright 2008 Sam Graham. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut