com.wiley.posa3.caching
Class CacheImpl

java.lang.Object
  extended bycom.wiley.posa3.caching.CacheImpl
All Implemented Interfaces:
Cache

public class CacheImpl
extends java.lang.Object
implements Cache

CacheImpl is an implementation of the Cache interface. It maintains and manages the cached resources and provides an API that allows acquisition and release of these resources.

Version:
1.0
Author:
Michael Kircher, Prashant Jain

Constructor Summary
CacheImpl()
           
 
Method Summary
 Resource acquire(Identity id)
          Acquire the resource from the cache corresponding to id.
 void release(Resource resource)
          Put the released resource into the cache so that it can be acquired later.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheImpl

public CacheImpl()
Method Detail

release

public void release(Resource resource)
Put the released resource into the cache so that it can be acquired later.

Specified by:
release in interface Cache
Parameters:
resource - the resource that has been released and is to be put into the cache

acquire

public Resource acquire(Identity id)
                 throws ResourceNotFound
Acquire the resource from the cache corresponding to id.

Specified by:
acquire in interface Cache
Parameters:
id - the identity of the resource that needs to be acquired.
Returns:
Resource corresponding to the Identity that should be in the cache.
Throws:
ResourceNotFound - is thrown if the resource corresponding to Identity was not found in the cache


Copyright 2004 John Wiley and Sons. All Rights Reserved.