final GemFireCacheImpl cache = (GemFireCacheImpl)getBucket().getCache(); if (cache != null && cache.isCacheAtShutdownAll()) { throw new CacheClosedException("Cache is shutting down");
/** * Attempt to acquire lock for primary until a primary exists. Caller hands * off responsibility to an executor (waiting pool) and returns early. */ public void volunteerForPrimary() { if (primaryElector != null) { return; } initializationGate(); synchronized (this) { if (isVolunteering() || isClosed() || !isHosting()) { // only one thread should be attempting to volunteer at one time return; } // if member is still not initialized then don't volunteer for primary final GemFireCacheImpl cache = (GemFireCacheImpl)getBucket().getCache(); if (!cache.doVolunteerForPrimary(this)) { return; } if (this.volunteeringDelegate == null) { this.volunteeringDelegate = new VolunteeringDelegate(); } this.volunteeringDelegate.volunteerForPrimary(); } }
/** * Attempt to acquire lock for primary until a primary exists. Caller hands * off responsibility to an executor (waiting pool) and returns early. */ public void volunteerForPrimary() { if (primaryElector != null) { return; } initializationGate(); synchronized (this) { if (isVolunteering() || isClosed() || !isHosting()) { // only one thread should be attempting to volunteer at one time return; } // if member is still not initialized then don't volunteer for primary final GemFireCacheImpl cache = (GemFireCacheImpl)getBucket().getCache(); if (!cache.doVolunteerForPrimary(this)) { return; } if (this.volunteeringDelegate == null) { this.volunteeringDelegate = new VolunteeringDelegate(); } this.volunteeringDelegate.volunteerForPrimary(); } }
final GemFireCacheImpl cache = (GemFireCacheImpl)getBucket().getCache(); if (cache != null && cache.isCacheAtShutdownAll()) { throw new CacheClosedException("Cache is shutting down");