/** return a CacheClosedException with the given reason */ public CacheClosedException getCacheClosedException(String reason, Throwable cause) { CacheClosedException result; if (cause != null) { result = new CacheClosedException(reason, cause); } else if (this.disconnectCause != null) { result = new CacheClosedException(reason, this.disconnectCause); } else { result = new CacheClosedException(reason); } return result; }
/** return a CacheClosedException with the given reason */ public CacheClosedException getCacheClosedException(String reason, Throwable cause) { CacheClosedException result; if (cause != null) { result = new CacheClosedException(reason, cause); } else if (this.disconnectCause != null) { result = new CacheClosedException(reason, this.disconnectCause); } else { result = new CacheClosedException(reason); } return result; }
/** * Pdx is allowed to obtain the cache even while it is being closed */ public static GemFireCacheImpl getForPdx(String reason) { final GemFireCacheImpl result = pdxInstance; if (result != null) { return result; } throw new CacheClosedException(reason); }
public static SimpleMemoryAllocatorImpl getAllocator() { SimpleMemoryAllocatorImpl result = singleton; if (result == null) { throw new CacheClosedException("Off Heap memory allocator does not exist."); } return result; }
public static SimpleMemoryAllocatorImpl getAllocator() { final SimpleMemoryAllocatorImpl result = singleton; if (result != null) { return result; } else { throw new CacheClosedException( "Off Heap memory allocator does not exist."); } }
public static PdxSerializer getPdxSerializer() { PdxSerializer result = pdxSerializer.get(); if (result == null && !open && pdxSerializerWasSet) { throw new CacheClosedException("Could not PDX serialize because the cache was closed"); } return result; } public static AutoSerializableManager getAutoSerializableManager() {
/** * Return the {@link GemFireStore} instance that may still be in the process * of being booted. */ public final static GemFireStore getMemStoreBooting() { final GemFireStore memStore = GemFireStore.getBootingInstance(); if (memStore != null) { return memStore; } throw new CacheClosedException("Misc#getMemStoreBooting: no store found." + " GemFireXD not booted or closed down."); }
/** * Set the {@link VMKind} for this VM. */ final synchronized void setVMKind(VMKind newKind) { final GemFireStore store = GemFireStore.getBootingInstance(); if (store != null) { store.myKind = newKind; // volatile write } throw new CacheClosedException("StoreAdvisee#setVMKind: no store found." + " GemFireXD not booted or closed down."); }
@Override public RuntimeException generateCancelledException(Throwable e) { if (isClosed()) { return new CacheClosedException("The disk store is closed", e); } else { return null; } }
/** * Return the {@link GemFireStore} instance. */ public final static GemFireStore getMemStore() { final GemFireStore memStore = GemFireStore.getBootedInstance(); if (memStore != null) { return memStore; } throw new CacheClosedException("Misc#getMemStore: no store found." + " GemFireXD not booted or closed down."); }
/** * Return the {@link GemFireStore} instance. */ public final static GemFireStore getMemStore() { final GemFireStore memStore = GemFireStore.getBootedInstance(); if (memStore != null) { return memStore; } throw new CacheClosedException("Misc#getMemStore: no store found." + " GemFireXD not booted or closed down."); }
/** * Return the {@link GemFireStore} instance. */ public final static GemFireStore getMemStore() { final GemFireStore memStore = GemFireStore.getBootedInstance(); if (memStore != null) { return memStore; } throw new CacheClosedException("Misc#getMemStore: no store found." + " GemFireXD not booted or closed down."); }
private void preOp() { if (this.proxyCache.isClosed()) { throw new CacheClosedException("Cache is closed for this user."); } UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes()); }
private void preOp(boolean setTL) { if (this.proxyCache.isClosed()) { throw new CacheClosedException("Cache is closed for this user."); } if (setTL) { UserAttributes.userAttributes.set(this.proxyCache.getUserAttributes()); } }
/** * Get the {@link GfxdDistributionAdvisor} of this VM. */ public static GfxdDistributionAdvisor getGfxdAdvisor() { final GfxdDistributionAdvisor advisor = Misc.getMemStoreBooting() .getDistributionAdvisor(); if (advisor != null) { return advisor; } throw new CacheClosedException("GemFireXDUtils#getGfxdAdvisor: " + "no advisor found. GemFireXD not booted or closed down."); }
/** * Get the {@link GfxdDistributionAdvisor} of this VM. */ public static GfxdDistributionAdvisor getGfxdAdvisor() { final GfxdDistributionAdvisor advisor = Misc.getMemStoreBooting() .getDistributionAdvisor(); if (advisor != null) { return advisor; } throw new CacheClosedException("GemFireXDUtils#getGfxdAdvisor: " + "no advisor found. GemFireXD not booted or closed down."); }
@Override public RuntimeException generateCancelledException(Throwable e) { // --- // This grossness is necessary because there are instances where the // region can exist without having a cache (XML creation) Cache c = LocalRegion.this.getCache(); if (c == null) { return new CacheClosedException("No cache", e); } // --- end of grossness return c.getCancelCriterion().generateCancelledException(e); }
@Override public RuntimeException generateCancelledException(Throwable t) { final RuntimeException ce; if ((ce = store.getAdvisee().getCancelCriterion() .generateCancelledException(t)) != null) { return ce; } return new CacheClosedException(MessageService.getCompleteMessage( SQLState.CLOUDSCAPE_SYSTEM_SHUTDOWN, null), t); }
protected void checkInterruptedByShutdownAll() { // when ShutdownAll is on-going, break all the GII for BR if (proxyBucket.getCache().isCacheAtShutdownAll()) { throw new CacheClosedException("Cache is being closed by ShutdownAll"); } proxyBucket.getPartitionedRegion().checkReadiness(); }
protected void checkInterruptedByShutdownAll() { // when ShutdownAll is on-going, break all the GII for BR if (proxyBucket.getCache().isCacheAtShutdownAll()) { throw new CacheClosedException("Cache is being closed by ShutdownAll"); } proxyBucket.getPartitionedRegion().checkReadiness(); }