private DistributedLockService initializeDistributedLockService(String dlsName) { DistributedLockService lockService = DistributedLockService.getServiceNamed(dlsName); if (lockService == null) { lockService = DistributedLockService.create(dlsName, this.cache.getDistributedSystem()); } return lockService; }
@Before public void setup() { Properties properties = new Properties(); properties.put(ConfigurationProperties.LOCATORS, ""); properties.put(ConfigurationProperties.MCAST_PORT, "0"); system = DistributedSystem.connect(properties); lockService = DistributedLockService.create("Test Lock Service", system); }
private DistributedLockService getLockService(DistributionManager dm) { DistributedLockService dls = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME); if (dls == null) { synchronized (LOCK_SYNC) { dls = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME); if (dls == null) { // Create the DistributedLockService dls = DistributedLockService.create(LOCK_SERVICE_NAME, dm.getSystem()); } } } Assert.assertTrue(dls != null); return dls; } }
private DistributedLockService initializeDistributedLockService(String dlsName) { DistributedLockService lockService = DistributedLockService.getServiceNamed(dlsName); if (lockService == null) { lockService = DistributedLockService.create(dlsName, this.cache.getDistributedSystem()); } return lockService; } }