1 23 package com.sun.appserv.management.client.handler; 24 25 import java.util.Set ; 26 import java.util.Map ; 27 import java.util.HashMap ; 28 import java.util.Collections ; 29 30 import java.util.logging.Logger ; 31 import com.sun.appserv.management.base.LoggerSupport; 32 33 36 class CacheBase<K,V> 37 { 38 private final Map <K,V> mCache; 39 40 42 public 43 CacheBase() 44 { 45 mCache = Collections.synchronizedMap( new HashMap <K,V>() ); 46 } 47 48 51 public void 52 cacheItem( 53 final K key, 54 final V value ) 55 { 56 mCache.put( key, value ); 57 } 58 59 public V 60 getCachedItem( K key ) 61 { 62 return( mCache.get( key ) ); 63 } 64 65 public void 66 remove( final K key ) 67 { 68 mCache.remove( key ); 69 } 70 71 public Set <K> 72 keySet() 73 { 74 return( mCache.keySet() ); 75 } 76 } 77 78 79 80 81 82 | Popular Tags |