view 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
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);
	}
	
}