List of usage examples for org.springframework.data.gemfire CacheFactoryBean getObject
@Override @SuppressWarnings("all") public GemFireCache getObject() throws Exception
From source file:org.grails.datastore.mapping.gemfire.GemfireDatastore.java
public void afterPropertiesSet() throws Exception { CacheFactoryBean cacheFactory = new CacheFactoryBean(); if (connectionDetails != null) { if (connectionDetails.containsKey(SETTING_CACHE_XML)) { Object entry = connectionDetails.remove(SETTING_CACHE_XML); if (entry instanceof Resource) { cacheFactory.setCacheXml((Resource) entry); } else { cacheFactory.setCacheXml(new ClassPathResource(entry.toString())); }/*www .j a v a 2 s .c o m*/ } if (connectionDetails.containsKey(SETTING_PROPERTIES)) { Object entry = connectionDetails.get(SETTING_PROPERTIES); if (entry instanceof Properties) { cacheFactory.setProperties((Properties) entry); } else if (entry instanceof Map) { final Properties props = new Properties(); props.putAll((Map) entry); cacheFactory.setProperties(props); } } } try { if (gemfireCache == null) { cacheFactory.afterPropertiesSet(); gemfireCache = cacheFactory.getObject(); } initializeRegions(gemfireCache, mappingContext); initializeConverters(mappingContext); } catch (Exception e) { throw new DatastoreConfigurationException( "Failed to configure Gemfire cache and regions: " + e.getMessage(), e); } }