NAME

Cache::CacheFactory::Object - the data stored in a Cache::CacheFactory cache.

DESCRIPTION

Cache::CacheFactory::Object is a subclass extending Cache::Object to allow for per-policy meta-data needed by Cache::CacheFactory's policies.

You will not normally need to use this class for anything.

If you are already using Cache::Object then you'll find that Cache::CacheFactory::Object only extends behaviour, it doesn't alter existing behaviour.

SYNOPSIS

use Cache::CacheFactory::Object;

my $object = Cache::CacheFactory::Object( );

$object->set_key( $key );
$object->set_data( $data );
$object->set_expires_at( $expires_at );
$object->set_created_at( $created_at );
$object->set_policy_metadata( 'expiry', 'time', $metadata );

METHODS

$object = Cache::CacheFactory::Object->new_from_old( $cache_object, [ $param ] );

Construct a new Cache::CacheFactory::Object from a Cache::Object instance, this is done automatically by Cache::CacheFactory methods that provide backwards compat.

$param is an optional argument that contains additional parameters to pass to $object->initialize().

$object->initialize( $key, $data, $param );

Initializes the object, this is done seperately from the constructor to make it easier for people to subclass Cache::CacheFactory::Object should they need to.

$object->set_policy_metadata( $policytype, $policy, $metadata );

Set the meta-data for the given $policytype and $policy to the value provided in $metadata, usually a hashref.

See the documentation on Cache::CacheFactory for more information about policy types and policies.

$metadata = $object->get_policy_metadata( $policytype, $policy );

Fetch the meta-data stored by $policytype and $policy.

See the documentation on Cache::CacheFactory for more information about policy types and policies.

All other behaviour is inherited from and documented by Cache::Object.

SEE ALSO

Cache::CacheFactory, Cache::Object

AUTHORS

Original author: Sam Graham <libcache-cachefactory-perl BLAHBLAH illusori.co.uk>

Last author: $Author: illusori $

COPYRIGHT

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.