KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > persistence > impl > InMemoryPersistentMapStore


1 /*
2  * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
3  * notice. All rights reserved.
4  */

5 package com.tc.objectserver.persistence.impl;
6
7 import com.tc.objectserver.persistence.api.PersistentMapStore;
8
9 import java.util.Hashtable JavaDoc;
10 import java.util.Map JavaDoc;
11
12 public class InMemoryPersistentMapStore implements PersistentMapStore {
13
14   Map JavaDoc map = new Hashtable JavaDoc();
15
16   public String JavaDoc get(String JavaDoc key) {
17     return (String JavaDoc) map.get(key);
18   }
19
20   public void put(String JavaDoc key, String JavaDoc value) {
21     map.put(key, value);
22   }
23
24   public boolean remove(String JavaDoc key) {
25     return (map.remove(key) != null);
26   }
27
28 }
29
Popular Tags