private void pushToApplicationCache(int typeToProcess, int typeAfterProcess)
    {
        for(Iterator iter = sessionCache.values().iterator(); iter.hasNext();)
        {
            CacheEntry entry = (CacheEntry) iter.next();
            // if the cached object was garbage collected, nothing to do
            Object result = entry.get();
            if(result == null)
            {
                if(log.isDebugEnabled())
                    log.debug("Object in session cache was gc, nothing to push to application cache");
            }
            else
            {
                // push all objects of the specified type to application cache
                if(entry.type == typeToProcess)
                {
                    if(log.isDebugEnabled())
                    {
                        log.debug("Move obj from session cache --> application cache : " + entry.oid);
                    }
                    /*
                    arminw:
                    only cache non-proxy or real subject of materialized proxy objects
                    */
                    if(ProxyHelper.isMaterialized(result))
                    {
                        putToApplicationCache(entry.oid, ProxyHelper.getRealObject(result), false);
                        // set the new type after the object was pushed to application cache
                        entry.type = typeAfterProcess;
                    }
                }
            }
        }
    }
private void pushToApplicationCache ( int typeToProcess , int typeAfterProcess ) { for ( Iterator iter = sessionCache . values ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { CacheEntry entry = ( CacheEntry ) iter . next ( ) ; Object result = entry . get ( ) ; if ( result == null ) { if ( log . isDebugEnabled ( ) ) log . debug ( "Object in session cache was gc, nothing to push to application cache" ) ; } else { if ( entry . type == typeToProcess ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Move obj from session cache --> application cache : " + entry . oid ) ; } if ( ProxyHelper . isMaterialized ( result ) ) { putToApplicationCache ( entry . oid , ProxyHelper . getRealObject ( result ) , false ) ; entry . type = typeAfterProcess ; } } } } }
Push all cached objects of the specified type, e.g. like {@link #TYPE_WRITE} to
the application cache and reset type to the specified one.