/* (non-Javadoc)
@see org.kie.common.BetaNodeConstraints#isAllowedCachedLeft(java.lang.Object)
511330
public boolean isAllowedCachedLeft(final ContextEntry[] context,
                                       final InternalFactHandle handle) {
        return this.indexed || this.constraint.isAllowedCachedLeft(context[0],
                                                                   handle);
    }
588158
private boolean hasSortedPrefix(SelectScope scope, SqlNodeList orderList) {
		return isSortCompatible(scope, orderList.get(0), false);
	}
505515
function (fragmentKey, cachePath, skipCache, callback) {
    if (skipCache) {
      debug('  cache is disabled so...');
      callback(false);
    } else {
      fs.exists(cachePath + '/' + fragmentKey, callback);
    }
  }
1115604
boolean isAllowed(String attribute) {
        if (attribute != null) {
            for (AclMatch rule : acl) {
                if (rule.matches(attribute)) {
                    return !rule.isDeny();
                }
            }
        }
        return defaultAllow;
    }
1317090
private boolean isCacheValid()
  {
    long now = CurrentTime.currentTime();

    if ((now - _lastTime < 100) && ! CurrentTime.isTest())
      return true;

    long oldLastModified = _lastModified;
    long oldLength = _length;
    
    long newLastModified = getBacking().getLastModified();
    long newLength = getBacking().length();
    
    _lastTime = now;

    if (newLastModified == oldLastModified && newLength == oldLength) {
      _lastTime = now;
      return true;
    }
    else {
      _changeSequence.incrementAndGet();
      
      // If the file has changed, close the old file
      clearCache();
      
      _zipEntryCache.clear();
      
      _lastModified = newLastModified;
      _length = newLength;
      
      _lastTime = now;

      return false;
    }
  }
264062
@Override
    public void setJMSRedelivered(boolean arg0) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setJMSRedelivered", arg0);

        if (arg0 == false) {
            // This is well defined.
            msg.setRedeliveredCount(0);
        }
        else {
            // This is quite arbitrary, however the user application only calls
            // this if the want to alter the value after the message has been received,
            // in which case they get what they deserve.
            msg.setRedeliveredCount(1);
        }

        // Invalidate the toString cache
        cachedToString = null;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setJMSRedelivered");
    }
436839
public boolean isCacheable(Cache cache, Object target, Object[] arguments, Object result) throws Exception {
        boolean rv = true;
        if (null != cache.condition() && cache.condition().length() > 0) {
            rv = this.getElValue(cache.condition(), target, arguments, result, true, Boolean.class);
        }
        return rv;
    }
1298317
void cache(ManagedObject managedObject) {
        // Make a local reference to cachedManagedObjects in case it is changing, there is a risk that 
        // the same slot in cachedMangedObjects will be used twice, in that case the Object is not 
        // cached and will be read again when referenced.
        java.lang.ref.SoftReference[] localCachedManagedObjects = cachedManagedObjects;
        int localICache = iCache++;
        if (localICache >= localCachedManagedObjects.length) {
            iCache = 0;
            localICache = 0;
        }

        localCachedManagedObjects[localICache] = new java.lang.ref.SoftReference(managedObject);
        managedObject.objectStoreCacheIndex = localICache;
    }
841938
public void notifyReceiveAllowed(boolean isAllowed, DestinationHandler destinationBeingModified)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "notifyReceiveAllowed", Boolean.valueOf(isAllowed));

    if (consumerPoint.destinationMatches(destinationBeingModified, consumerDispatcher))
    {
      consumerPoint.notifyReceiveAllowed(isAllowed);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "notifyReceiveAllowed");
  }
1084307
@Override
    public IsNullValueDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException {
        MethodGen methodGen = getMethodGen(analysisCache, descriptor);
        if (methodGen == null) {
            throw new MethodUnprofitableException(descriptor);
        }
        CFG cfg = getCFG(analysisCache, descriptor);
        ValueNumberDataflow vnaDataflow = getValueNumberDataflow(analysisCache, descriptor);
        DepthFirstSearch dfs = getDepthFirstSearch(analysisCache, descriptor);
        AssertionMethods assertionMethods = getAssertionMethods(analysisCache, descriptor.getClassDescriptor());
        TypeDataflow typeDataflow = getTypeDataflow(analysisCache, descriptor);

        IsNullValueAnalysis invAnalysis = new IsNullValueAnalysis(descriptor, methodGen, cfg, vnaDataflow, typeDataflow, dfs,
                assertionMethods);

        // Set return value and parameter databases

        invAnalysis.setClassAndMethod(new JavaClassAndMethod(getJavaClass(analysisCache, descriptor.getClassDescriptor()),
                getMethod(analysisCache, descriptor)));

        IsNullValueDataflow invDataflow = new IsNullValueDataflow(cfg, invAnalysis);
        invDataflow.execute();
        if (ClassContext.DUMP_DATAFLOW_ANALYSIS) {
            invDataflow.dumpDataflow(invAnalysis);
        }
        return invDataflow;

    }
609176
public void checkCacheMode(Boolean boolShouldBeCached)
    {
        try {
            boolean bCurrentlyCached = (this.getRemoteTableType(CachedRemoteTable.class) != null);
            if ((this.getRecord().getOpenMode() & DBConstants.OPEN_CACHE_RECORDS) == DBConstants.OPEN_CACHE_RECORDS)
                boolShouldBeCached = Boolean.TRUE;
//            if ((this.getRecord().getOpenMode() & DBConstants.OPEN_READ_ONLY) == DBConstants.OPEN_READ_ONLY);
//                    bShouldBeCached = true;
            if ((this.getRecord().getOpenMode() & DBConstants.OPEN_DONT_CACHE) == DBConstants.OPEN_DONT_CACHE)
                boolShouldBeCached = Boolean.FALSE;
            if (boolShouldBeCached == null)
                return;     // Not specified, Don't change.
            if ((!bCurrentlyCached) && (boolShouldBeCached.booleanValue()))
            {   // Add a cache
                Utility.getLogger().info("Cache ON: " + this.getRecord().getTableNames(false));
                this.setRemoteTable(new CachedRemoteTable(m_tableRemote));
            }
            else if ((bCurrentlyCached) && (!boolShouldBeCached.booleanValue()))
            {   // Remove the cache
                Utility.getLogger().info("Cache OFF: " + this.getRecord().getTableNames(false));
//                RemoteTable tableRemote = this.getRemoteTableType(org.jbundle.model.Remote.class);
                RemoteTable tableRemote = this.getRemoteTableType(CachedRemoteTable.class).getRemoteTableType(null);
                ((CachedRemoteTable)m_tableRemote).setRemoteTable(null);
                ((CachedRemoteTable)m_tableRemote).free();
                this.setRemoteTable(tableRemote);
            }
        } catch (RemoteException ex)    {
            // Never for this usage
        }
    }
1105832
private Boolean switchCheckAndAbortLocked() {
    if (!hasExpansionOccurred()) {
      clearOutReferences();
      return true;
    }
    hashArray = hash.getEntries();
    clearCount = hash.getClearOrCloseCount();
    boolean _cacheClosed = hashArray == null;
    if (_cacheClosed) {
      clearOutReferences();
      throw new CacheClosedException(cache);
    }
    return false;
  }
1149467
public boolean hasCache() {
        if (isCache()) {
            return true;
        }
        if (CommonUtils.isNotEmpty(methods)) {
            for (MethodConfig methodConfig : methods.values()) {
                if (CommonUtils.isTrue(methodConfig.getCache())) {
                    return true;
                }
            }
        }
        return false;
    }
1271962
protected void changedCacheData (String cache, final Streamable data)
    {
        // see if we have any observers
        ObserverList<StaleCacheObserver> list = _cacheobs.get(cache);
        if (list == null) {
            return;
        }
        // if so, notify them
        list.apply(new ObserverList.ObserverOp<StaleCacheObserver>() {
            public boolean apply (StaleCacheObserver observer) {
                observer.changedCacheData(data);
                return true;
            }
        });
    }
618187
@Override
    public String getCacheDigest(String cacheInstance, boolean useMemoryCacheDigest,
                                 boolean cacheIDOnly, boolean debug) throws javax.management.AttributeNotFoundException { // LI4337-17

        if (tc.isEntryEnabled()) {
            Tr.entry(tc, "getCacheDigest: cacheInstance=" + cacheInstance + " useMemoryCacheDigest=" + useMemoryCacheDigest +
                         " cacheIDOnly=" + cacheIDOnly + " debug=" + debug);
        }
        // Get the cache for this cacheInstance
        DCache cache1 = getCache(cacheInstance);

        // Get the message digest
        getMessageDigestMD5();

        // Calculate total hashcode for cache ids and cache value in memory cache  
        int totalHashcode = cache1.getMemoryCacheHashcode(debug, !cacheIDOnly);

        if (cacheIDOnly == true) {
            // Calculate total hashcode for cache ids in PushPullTable  
            totalHashcode += cache1.getCacheIdsHashcodeInPushPullTable(debug);
        }

        if (useMemoryCacheDigest == false) {
            // Calculate total hashcode for cache ids and cache value in disk cache  
            try {
                totalHashcode += cache1.getDiskCacheHashcode(debug, !cacheIDOnly);
            } catch (DynamicCacheException e) {
                Tr.error(tc, "DYNA1053E", new Object[] { DynaCacheConstants.MBEAN_GET_CACHE_DIGEST, e.getMessage() });
                throw new AttributeNotFoundException(e.getMessage());
            }
        }

        // Convert hashcode to MD5 digest
        String md5Hash = MessageDigestUtility.processMessageDigestForData(MBeans.messageDigestMD5, totalHashcode);

        if (tc.isEntryEnabled()) {
            Tr.exit(tc, "getCacheDigest: Exiting. Entire cache hash in MD5 is " + md5Hash + " for cacheInstance = " + cacheInstance);
        }
        return md5Hash;
    }
1300565
@CacheEntryModified
   @SuppressWarnings({"unused", "unchecked"})
   public void nodeModified(CacheEntryModifiedEvent event) {
      if ( !event.isPre() ) {
         updateLocalCache( event.getKey(), event.getValue() );
      }
   }
761830
public ExternalInvalidation filterExternalCacheFragment(String cacheName, ExternalInvalidation externalCacheFragment) {
		InvalidationTableList invalidationTableList = getInvalidationTableList(cacheName);
		try {
			invalidationTableList.readWriteLock.readLock().lock();
			return internalFilterExternalCacheFragment(cacheName, invalidationTableList, externalCacheFragment);
		} finally {
			invalidationTableList.readWriteLock.readLock().unlock();
		}
	}