com.petpet.c3po.api.dao
Interface ReadOnlyCache

All Known Subinterfaces:
Cache
All Known Implementing Classes:
DBCache

public interface ReadOnlyCache

A simple Read Only cache for Property, Source and any kind of other objects.

Author:
Petar Petrov

Method Summary
 Object getObject(Object key)
          Any other non-persistence layer object that can be cached.
 Property getProperty(String key)
          Retrieves the property designated by the given key.
 Source getSource(String name, String version)
          Retrieves the source designated by the given name and version.
 

Method Detail

getProperty

Property getProperty(String key)
Retrieves the property designated by the given key. Depending on the implementation it might return null or a new property if there was no property with the given key.

Parameters:
key - the key to look for.
Returns:
the cached property.

getSource

Source getSource(String name,
                 String version)
Retrieves the source designated by the given name and version. Depending on the implementation it might return null or a new source if there was no source with the given name and version.

Parameters:
name - the name of the source tool.
version - the version of the too.
Returns:

getObject

Object getObject(Object key)
Any other non-persistence layer object that can be cached.

Parameters:
key - the key for the cache.
Returns:
the object that was cached in memory.


Copyright © 2013. All Rights Reserved.