private MapStoreWrapper createMapStoreWrapper(MapStoreConfig mapStoreConfig, NodeEngine nodeEngine) {
final String name = getName();
Object store;
MapStoreWrapper storeWrapper;
try {
MapStoreFactory factory = (MapStoreFactory) mapStoreConfig.getFactoryImplementation();
if (factory == null) {
String factoryClassName = mapStoreConfig.getFactoryClassName();
if (factoryClassName != null && !"".equals(factoryClassName)) {
factory = ClassLoaderUtil.newInstance(nodeEngine.getConfigClassLoader(), factoryClassName);
}
}
store = (factory == null ? mapStoreConfig.getImplementation()
: factory.newMapStore(name, mapStoreConfig.getProperties()));
if (store == null) {
String mapStoreClassName = mapStoreConfig.getClassName();
store = ClassLoaderUtil.newInstance(nodeEngine.getConfigClassLoader(), mapStoreClassName);
}
} catch (Exception e) {