public static void validatePRRegionExpirationAttributes(ExpirationAttributes expAtts) { if (expAtts.getTimeout() > 0) { ExpirationAction expAction = expAtts.getAction(); if (expAction.isInvalidate() || expAction.isLocalInvalidate()) { throw new IllegalStateException( "ExpirationAction INVALIDATE or LOCAL_INVALIDATE for region is not supported for Partitioned Region."); } else if (expAction.isDestroy() || expAction.isLocalDestroy()) { throw new IllegalStateException( "ExpirationAction DESTROY or LOCAL_DESTROY for region is not supported for Partitioned Region."); } } }
protected boolean expire(ExpirationAction action, boolean isPending) throws CacheException { if (action.isInvalidate()) return invalidate(); if (action.isDestroy()) return destroy(isPending); if (action.isLocalInvalidate()) return localInvalidate(); if (action.isLocalDestroy()) return localDestroy(); throw new InternalGemFireError( String.format("unrecognized expiration action: %s", action)); }
if ((entryIdleTimeout.getAction().isLocalDestroy() && entryIdleTimeout.getTimeout() > 0) || (entryTimeToLive.getAction().isLocalDestroy() && entryTimeToLive.getTimeout() > 0)) { throw new IllegalStateException( "ExpirationAction LOCAL_DESTROY is not supported for Partitioned Region.");