private DistributedLockService getLockService() { return DistributedLockService .getServiceNamed(PartitionedRegionHelper.PARTITION_LOCK_SERVICE_NAME); }
/** * Destroys the GatewaySender distributed lock service when closing the cache. Caller must be * synchronized on this GemFireCache. */ private void destroyGatewaySenderLockService() { if (DistributedLockService.getServiceNamed(AbstractGatewaySender.LOCK_SERVICE_NAME) != null) { try { DistributedLockService.destroy(AbstractGatewaySender.LOCK_SERVICE_NAME); } catch (IllegalArgumentException ignore) { // DistributedSystem.disconnect may have already destroyed the DLS } } }
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; }
@Override public DistributedLockService getDLS() { InternalCache cache = getCache(); DistributedLockService dls = DistributedLockService.getServiceNamed(AUTO_BALANCER_LOCK_SERVICE_NAME); if (dls == null) { if (logger.isDebugEnabled()) { logger.debug("Creating DistributeLockService"); } dls = DLockService.create(AUTO_BALANCER_LOCK_SERVICE_NAME, cache.getInternalDistributedSystem(), true, true, true); } return dls; }
protected DistributedLockService getLockService() { if (this.dls != null) { return this.dls; } synchronized (this.dlsLock) { if (this.dls == null) { try { this.dls = DLockService.create(LOCK_SERVICE_NAME, this.cache.getInternalDistributedSystem(), true /* distributed */, true /* destroyOnDisconnect */, true /* automateFreeResources */); } catch (IllegalArgumentException e) { this.dls = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME); if (this.dls == null) { throw e; } } } return this.dls; } }
public void initDLockService() { InternalDistributedSystem ds = this.sender.getCache().getInternalDistributedSystem(); String dlsName = getDLockServiceName(); this.lockService = DistributedLockService.getServiceNamed(dlsName); if (this.lockService == null) { this.lockService = DLockService.create(dlsName, ds, true, true, true); } Assert.assertTrue(this.lockService != null); if (logger.isDebugEnabled()) { logger.debug("{}: Obtained DistributedLockService: {}", this, this.lockService); } }
/** * Gets or lazily creates the PartitionedRegion distributed lock service. This call will * synchronize on this GemFireCache. * * @return the PartitionedRegion distributed lock service */ @Override public DistributedLockService getPartitionedRegionLockService() { synchronized (this.prLockServiceLock) { this.stopper.checkCancelInProgress(null); if (this.prLockService == null) { try { this.prLockService = DLockService.create(PartitionedRegionHelper.PARTITION_LOCK_SERVICE_NAME, getInternalDistributedSystem(), true /* distributed */, true /* destroyOnDisconnect */, true /* automateFreeResources */); } catch (IllegalArgumentException e) { this.prLockService = DistributedLockService .getServiceNamed(PartitionedRegionHelper.PARTITION_LOCK_SERVICE_NAME); if (this.prLockService == null) { throw e; // PARTITION_LOCK_SERVICE_NAME must be illegal! } } } return this.prLockService; } }
/** * Gets or lazily creates the GatewaySender distributed lock service. * * @return the GatewaySender distributed lock service */ @Override public DistributedLockService getGatewaySenderLockService() { if (this.gatewayLockService == null) { synchronized (this.gatewayLockServiceLock) { this.stopper.checkCancelInProgress(null); if (this.gatewayLockService == null) { try { this.gatewayLockService = DLockService.create(AbstractGatewaySender.LOCK_SERVICE_NAME, getInternalDistributedSystem(), true /* distributed */, true /* destroyOnDisconnect */, true /* automateFreeResources */); } catch (IllegalArgumentException e) { this.gatewayLockService = DistributedLockService.getServiceNamed(AbstractGatewaySender.LOCK_SERVICE_NAME); if (this.gatewayLockService == null) { throw e; // AbstractGatewaySender.LOCK_SERVICE_NAME must be illegal! } } } } } return this.gatewayLockService; }
/** * Return the DistributedLockService associated with this Region. This method will lazily create * that service the first time it is invoked on this region. */ public DistributedLockService getLockService() { synchronized (this.dlockMonitor) { String dlsName = getFullPath(); if (this.dlockService == null) { this.dlockService = DistributedLockService.getServiceNamed(dlsName); if (this.dlockService == null) { // region destroy will destroy dls and manual freeResources only this.dlockService = DLockService.create(getFullPath(), getSystem(), true, false, false); } // handle is-lock-grantor region attribute... if (this.isLockGrantor) { this.dlockService.becomeLockGrantor(); } if (logger.isDebugEnabled()) { logger.debug("LockService for {} is using LockLease={}, LockTimeout={}", dlsName, getCache().getLockLease(), getCache().getLockTimeout()); } } return this.dlockService; } }
if (this.primaryLock == null) { DistributedLockService dls = DistributedLockService .getServiceNamed(PartitionedRegionHelper.PARTITION_LOCK_SERVICE_NAME); if (dls == null) { if (!createDLS || getProxyBucketRegion().getCache().isClosed()) { .getServiceNamed(PartitionedRegionHelper.PARTITION_LOCK_SERVICE_NAME); if (dls == null) {
private DistributedLockService initializeDistributedLockService(String dlsName) { DistributedLockService lockService = DistributedLockService.getServiceNamed(dlsName); if (lockService == null) { lockService = DistributedLockService.create(dlsName, this.cache.getDistributedSystem()); } return lockService; } }