FileDocCategorySizeDatePackage
AbstractCache.javaAPI DocExample1051Sun Mar 02 16:20:08 GMT 2003com.mediamania.hotcache

AbstractCache

public abstract class AbstractCache extends com.mediamania.MediaManiaApp implements com.mediamania.hotcache.CacheAccess

Fields Summary
protected Map
cache
Constructors Summary
protected AbstractCache()
Creates a new instance of AbstractCache. The AbstractCache is the base class for MasterCache and SlaveCache.


                          
      
    
Methods Summary
public com.mediamania.prototype.MoviegetMovieByTitle(java.lang.String title)
Get the Movie by title. If the movie is not in the cache, put it in.

param
title the title of the movie
return
the movie instance

        Movie movie = (Movie) cache.get(title);
        if (movie == null) {
            movie = PrototypeQueries.getMovie (pm, title);
            if (movie != null) {
                cache.put (title, movie);
            }
        }
        return movie;