Code example for Cache

Methods: getIfPresentinvalidate

0
     * @param cms the current CMS context   
     * @param siteRoot the site root for which the entry should be cleared  
     */ 
    public void clear(CmsObject cms, String siteRoot) {
 
        CmsUser originalUser = m_map.getIfPresent(siteRoot);
        if ((originalUser == null) || !originalUser.equals(cms.getRequestContext().getCurrentUser())) {
            return; 
        } 
        m_map.invalidate(siteRoot);
    } 
 
    /** 
     * Tries to update or create an entry for the given user/site root combination.<p> 
     *  
     * If this method succeeds, it will return null, but if another user has created an entry for the site root, 
     * it will return that user.<p> 
     *  
     * @param cms the current CMS context  
     * @param siteRoot the site root  
Connect your IDE to all the code out there  Get Codota for Java