*/
public void addCache(Cache cache) throws CacheException {
if(cache==null){
throw new NullPointerException("cache is null");
}
CacheConfig cacheConfig = cache.getCacheConfig();
if(cacheConfig==null) {
throw new NullPointerException("cache config is null");
}
if(cacheConfig.getCacheId()==null) {
throw new NullPointerException("config.getCacheId() is null");
}
if(!(cache instanceof Cache)) {
throw new CacheException("cache not instance of "+ManagedCache.class.getName());
}
synchronized(_cacheMap){
if(_cacheMap.containsKey(cacheConfig.getCacheId())) {
throw new CacheException("Cache id:"+cacheConfig.getCacheId()+" exists");
}
_cacheMap.put(cacheConfig.getCacheId(), cache);
}
}