view src/alice/datasegment/DataSegment.java @ 6:c78a1cc2cd8f

implements Reply
author one
date Thu, 12 Jan 2012 13:19:04 +0900
parents 91057e15065f
children 54bf607118ae
line wrap: on
line source

package alice.datasegment;

import java.util.concurrent.ConcurrentHashMap;

public class DataSegment {
	
	private static DataSegment dataSegment = new DataSegment();
	private ConcurrentHashMap<String, DataSegmentManager> dataSegmentManageres = new ConcurrentHashMap<String, DataSegmentManager>();
	
	private DataSegment() {
		dataSegmentManageres.put("local", new LocalDataSegmentManager());
	}
	
	public static DataSegmentManager get(String key) {
		return dataSegment.dataSegmentManageres.get(key);
	}
	
	public static void regist(String key, DataSegmentManager manager) {
		dataSegment.dataSegmentManageres.put(key, manager);
	}
	
}