comparison src/alice/datasegment/DataSegment.java @ 3:91057e15065f

add DataSegment API and CodeSegment
author one
date Wed, 11 Jan 2012 00:17:27 +0900
parents
children 54bf607118ae
comparison
equal deleted inserted replaced
2:f71eabb1df2a 3:91057e15065f
1 package alice.datasegment;
2
3 import java.util.concurrent.ConcurrentHashMap;
4
5 public class DataSegment {
6
7 private static DataSegment dataSegment = new DataSegment();
8 private ConcurrentHashMap<String, DataSegmentManager> dataSegmentManageres = new ConcurrentHashMap<String, DataSegmentManager>();
9
10 private DataSegment() {
11 dataSegmentManageres.put("local", new LocalDataSegmentManager());
12 }
13
14 public static DataSegmentManager get(String key) {
15 return dataSegment.dataSegmentManageres.get(key);
16 }
17
18 public static void regist(String key, DataSegmentManager manager) {
19 dataSegment.dataSegmentManageres.put(key, manager);
20 }
21
22 }