@Bean public HazelcastInstance hazelcastInstance() throws IOException { Resource config = this.cacheProperties.getHazelcast().getConfig(); Resource location = this.cacheProperties.resolveConfigLocation(config); if (location != null) { return new HazelcastInstanceFactory(location).getHazelcastInstance(); } return Hazelcast.newHazelcastInstance(); }
@Bean public HazelcastCacheManager cacheManager( HazelcastInstance existingHazelcastInstance) throws IOException { Resource config = this.cacheProperties.getHazelcast().getConfig(); Resource location = this.cacheProperties.resolveConfigLocation(config); if (location != null) { HazelcastInstance cacheHazelcastInstance = new HazelcastInstanceFactory( location).getHazelcastInstance(); return new CloseableHazelcastCacheManager(cacheHazelcastInstance); } return new HazelcastCacheManager(existingHazelcastInstance); }
@Bean public HazelcastInstance hazelcastInstance() throws IOException { Resource config = this.cacheProperties.getHazelcast().getConfig(); Resource location = this.cacheProperties.resolveConfigLocation(config); if (location != null) { new HazelcastInstanceFactory(location).getHazelcastInstance(); } return Hazelcast.newHazelcastInstance(); }