com.bankframe.services.cache
Class NullCache

java.lang.Object
  extended bycom.bankframe.services.cache.NullCache
All Implemented Interfaces:
Cache, java.util.Map, NamedCache

public class NullCache
extends java.lang.Object
implements Cache, NamedCache

This class implements Cache & NamedCache and is intended for use when a implementation code refers to a named cache, but at runtime caching is not required. The cache therefore has no memory overhead. Note that this cache always uses NullPolicy.INSTANCE. No other policy can be assigned.

Author:
pobrien

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Constructor Summary
NullCache()
          Constructor for NullCache.
 
Method Summary
 void cleanup()
          This method cleans up the cache by removing un-needed entries
 void clear()
           
 boolean containsKey(java.lang.Object arg0)
           
 boolean containsValue(java.lang.Object arg0)
           
 void enableCaching(boolean enableCache)
          This method enables or disables caching.
 java.util.Set entrySet()
           
 java.lang.Object get(java.lang.Object arg0)
           
 CachePolicy getCachePolicy()
          This method gets the CachePolicy object for this Cache
 java.lang.String getName()
          Returns the name.
 boolean isEmpty()
           
 java.util.Set keySet()
           
 java.lang.Object put(java.lang.Object arg0, java.lang.Object arg1)
           
 void putAll(java.util.Map arg0)
           
 java.lang.Object remove(java.lang.Object arg0)
           
 void remove(java.util.Set keySet)
          This method removes the specified keys from the cache and the data store
 void removeAll()
          Removes all objects from the cache and from the data store.
 void setCachePolicy(CachePolicy policy)
          This method sets the CachePolicy object for this Cache
 void setName(java.lang.String name)
          Returns the value.
 int size()
           
 java.util.Collection values()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

NullCache

public NullCache()
Constructor for NullCache.

Method Detail

cleanup

public void cleanup()
Description copied from interface: Cache
This method cleans up the cache by removing un-needed entries

Specified by:
cleanup in interface Cache
See Also:
Cache.cleanup()

enableCaching

public void enableCaching(boolean enableCache)
Description copied from interface: Cache
This method enables or disables caching. When caching is disabled the cache passes all operations on to the persistent map instance

Specified by:
enableCaching in interface Cache
Parameters:
enableCache - true to enable, false to disable
See Also:
Cache.enableCaching(boolean)

getCachePolicy

public CachePolicy getCachePolicy()
Description copied from interface: Cache
This method gets the CachePolicy object for this Cache

Specified by:
getCachePolicy in interface Cache
Returns:
CachePolicy instance or null if there is no CachePolicy
See Also:
Cache.getCachePolicy()

remove

public void remove(java.util.Set keySet)
Description copied from interface: Cache
This method removes the specified keys from the cache and the data store

Specified by:
remove in interface Cache
Parameters:
keySet - the keys to remove from the cache
See Also:
Cache.remove(Set)

removeAll

public void removeAll()
Description copied from interface: Cache
Removes all objects from the cache and from the data store. Use this method with caution!

Specified by:
removeAll in interface Cache
See Also:
Cache.removeAll()

setCachePolicy

public void setCachePolicy(CachePolicy policy)
Description copied from interface: Cache
This method sets the CachePolicy object for this Cache

Specified by:
setCachePolicy in interface Cache
Parameters:
policy - The new cache policy
See Also:
Cache.setCachePolicy(CachePolicy)

setName

public void setName(java.lang.String name)
Description copied from interface: NamedCache
Returns the value.

Specified by:
setName in interface NamedCache
Parameters:
name - String
See Also:
NamedCache.setName(String)

getName

public java.lang.String getName()
Description copied from interface: NamedCache
Returns the name.

Specified by:
getName in interface NamedCache
Returns:
String
See Also:
NamedCache.getName()

size

public int size()
Specified by:
size in interface java.util.Map
See Also:
Map.size()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map
See Also:
Map.isEmpty()

containsKey

public boolean containsKey(java.lang.Object arg0)
Specified by:
containsKey in interface java.util.Map
See Also:
Map.containsKey(Object)

containsValue

public boolean containsValue(java.lang.Object arg0)
Specified by:
containsValue in interface java.util.Map
See Also:
Map.containsValue(Object)

get

public java.lang.Object get(java.lang.Object arg0)
Specified by:
get in interface java.util.Map
See Also:
Map.get(Object)

put

public java.lang.Object put(java.lang.Object arg0,
                            java.lang.Object arg1)
Specified by:
put in interface java.util.Map
See Also:
Map.put(Object, Object)

remove

public java.lang.Object remove(java.lang.Object arg0)
Specified by:
remove in interface java.util.Map
See Also:
Map.remove(Object)

putAll

public void putAll(java.util.Map arg0)
Specified by:
putAll in interface java.util.Map
See Also:
Map.putAll(Map)

clear

public void clear()
Specified by:
clear in interface java.util.Map
See Also:
Map.clear()

keySet

public java.util.Set keySet()
Specified by:
keySet in interface java.util.Map
See Also:
Map.keySet()

values

public java.util.Collection values()
Specified by:
values in interface java.util.Map
See Also:
Map.values()

entrySet

public java.util.Set entrySet()
Specified by:
entrySet in interface java.util.Map
See Also:
Map.entrySet()


Copyright © 2004 Siebel Systems, Inc. All rights reserved.