1 22 package org.jboss.util; 23 24 25 32 public final class SynchronizedCachePolicy 33 implements CachePolicy 34 { 35 36 38 private final CachePolicy delegate; 39 40 42 public SynchronizedCachePolicy(CachePolicy delegate) 43 { 44 this.delegate = delegate; 45 } 46 47 49 synchronized public Object get(Object key) 50 { 51 return delegate.get(key); 52 } 53 54 synchronized public Object peek(Object key) 55 { 56 return delegate.get(key); 57 } 58 59 synchronized public void insert(Object key, Object object) 60 { 61 delegate.insert(key, object); 62 } 63 64 synchronized public void remove(Object key) 65 { 66 delegate.remove(key); 67 } 68 69 synchronized public void flush() 70 { 71 delegate.flush(); 72 } 73 74 synchronized public int size() 75 { 76 return delegate.size(); 77 } 78 79 synchronized public void create() throws Exception 80 { 81 delegate.create(); 82 } 83 84 synchronized public void start() throws Exception 85 { 86 delegate.start(); 87 } 88 89 synchronized public void stop() 90 { 91 delegate.stop(); 92 } 93 94 synchronized public void destroy() 95 { 96 delegate.destroy(); 97 } 98 } 99 | Popular Tags |