The method called by the scheduled update action to update the cache.<p>
774232
public void performUpdate() {

        // Wrap everything in try-catch because we don't want to leak an exception out of a scheduled task
        try {
            ArrayList<Object> work = new ArrayList<>();
            m_workQueue.drainTo(work);
            Set<CmsUUID> copiedIds = new HashSet<CmsUUID>();
            List<CmsWaitHandle> waitHandles = new ArrayList<>();
            for (Object o : work) {
                if (o instanceof CmsUUID) {
                    copiedIds.add((CmsUUID)o);
                } else if (o instanceof CmsWaitHandle) {
                    waitHandles.add((CmsWaitHandle)o);
                }
            }
            if (copiedIds.contains(RELOAD_MARKER)) {
                // clear cache event, reload all formatter configurations
                reload();
            } else {
                // normal case: incremental update
                Map<CmsUUID, I_CmsFormatterBean> formattersToUpdate = Maps.newHashMap();
                for (CmsUUID structureId : copiedIds) {
                    I_CmsFormatterBean formatterBean = readFormatter(structureId);
                    // formatterBean may be null here
                    formattersToUpdate.put(structureId, formatterBean);
                }
                m_state = m_state.createUpdatedCopy(formattersToUpdate);
            }
            for (CmsWaitHandle handle : waitHandles) {
                handle.release();
            }
        } catch (Exception e) {
            LOG.error(e.getLocalizedMessage(), e);
        }
    }
145468
public void updateCache() {

        synchronized (partitions) {

            if (partitions.isEmpty()) {
                this.slotCache = EMPTY;
                this.nodeReadView = Collections.emptyList();
                return;
            }

            RedisClusterNode[] slotCache = new RedisClusterNode[SlotHash.SLOT_COUNT];
            List<RedisClusterNode> readView = new ArrayList<>(partitions.size());

            for (RedisClusterNode partition : partitions) {

                readView.add(partition);
                for (Integer integer : partition.getSlots()) {
                    slotCache[integer.intValue()] = partition;
                }
            }

            this.slotCache = slotCache;
            this.nodeReadView = Collections.unmodifiableCollection(readView);
        }
    }
394797
public void actionUpdate() throws JspException {

        // save initialized instance of this class in request attribute for included sub-elements
        getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);

        try {
            // prepare the publish scheduled resource
            performDialogOperation();
            // close the dialog
            actionCloseDialog();
        } catch (Throwable e) {
            // show the error page
            includeErrorpage(this, e);
        }
    }
985652
void asyncUpdate() {

        CmsRpcAction<Boolean> action = new CmsRpcAction<Boolean>() {

            @Override
            public void execute() {

                start(200, false);
                m_controller.getContainerpageService().checkContainerpageOrElementsChanged(
                    CmsCoreProvider.get().getStructureId(),
                    CmsContainerpageController.get().getData().getDetailId(),
                    CmsContainerpageController.get().getData().getLocale(),
                    this);
            }

            @Override
            protected void onResponse(Boolean result) {

                stop(false);
                boolean changed = result.booleanValue();
                setChanged(changed);
            }

        };
        action.execute();
    }
6295
@Override
    public synchronized void run(){
        Date now = new Date();
        if ( !cache.isEmpty() &&
                ((cache.size() > cacheSize - 1) || (now.getTime() - lastCacheAccess.getTime() > cacheMillis))) {
            try {
                flush();
            } catch (RepositoryException e) {
                log.error(e.getLocalizedMessage());
                throw new RuntimeException(e);
            } catch (MalformedQueryException e) {
                log.error(e.getLocalizedMessage());
                throw new RuntimeException(e);
            } catch (UpdateExecutionException e) {
                log.error(e.getLocalizedMessage());
                throw new RuntimeException(e);
            } catch (IOException e) {
                log.error(e.getLocalizedMessage());
                throw new RuntimeException(e);
            }
        }
    }
944515
private synchronized void updateLocal() throws ScheduleManagerException {
    final List<Schedule> updates = this.loader.loadUpdatedSchedules();
    for (final Schedule s : updates) {
      if (s.getStatus().equals(TriggerStatus.EXPIRED.toString())) {
        onScheduleExpire(s);
      } else {
        internalSchedule(s);
      }
    }
  }
65772
public void prepareUpdateStep1b() {

        if (!isInitialized()) {
            return;
        }

        if ((m_dbUpdateThread != null) && (m_dbUpdateThread.isFinished())) {
            // update is already finished, just wait for client to collect final data
            return;
        }

        if (m_dbUpdateThread == null) {
            m_dbUpdateThread = new CmsUpdateDBThread(this);
        }

        if (!m_dbUpdateThread.isAlive()) {
            m_dbUpdateThread.start();
        }
    }
398116
void submit() {

        int action = -1;

        if (isModeAll()) {
            action = CmsFlexCache.CLEAR_ONLINE_ALL;
        } else {
            action = CmsFlexCache.CLEAR_ONLINE_ENTRIES;
        }

        OpenCms.fireCmsEvent(
            new CmsEvent(
                I_CmsEventListener.EVENT_FLEX_CACHE_CLEAR,
                Collections.<String, Object> singletonMap(CmsFlexCache.CACHE_ACTION, new Integer(action))));
    }
1369522
private static void deleteCacheInfoUpdate(CacheStatus cacheStatus) {
    if (!cacheStatus.isInited()) {
      // if it is not created yet, do nothing.
      return;
    }
    synchronized (baseDirSize) {
      Long dirSize = baseDirSize.get(cacheStatus.getBaseDir());
      if ( dirSize != null ) {
        dirSize -= cacheStatus.size;
        baseDirSize.put(cacheStatus.getBaseDir(), dirSize);
      }
    }
    synchronized (baseDirNumberSubDir) {
      Integer dirSubDir = baseDirNumberSubDir.get(cacheStatus.getBaseDir());
      if ( dirSubDir != null ) {
        dirSubDir--;
        baseDirNumberSubDir.put(cacheStatus.getBaseDir(), dirSubDir);
      }
    }
  }
114273
@Override
    public void actionCommit() {

        try {
            int action = -1;
            if (isOnline() && isOffline()) {
                if (getMode().equals(MODE_ALL)) {
                    action = CmsFlexCache.CLEAR_ALL;
                } else {
                    action = CmsFlexCache.CLEAR_ENTRIES;
                }
            } else if (isOnline()) {
                if (getMode().equals(MODE_ALL)) {
                    action = CmsFlexCache.CLEAR_ONLINE_ALL;
                } else {
                    action = CmsFlexCache.CLEAR_ONLINE_ENTRIES;
                }
            } else if (isOffline()) {
                if (getMode().equals(MODE_ALL)) {
                    action = CmsFlexCache.CLEAR_OFFLINE_ALL;
                } else {
                    action = CmsFlexCache.CLEAR_OFFLINE_ENTRIES;
                }
            } else {
                if (getMode().equals(MODE_ALL)) {
                    action = CmsFlexCache.CLEAR_ALL;
                } else {
                    action = CmsFlexCache.CLEAR_ENTRIES;
                }
            }
            OpenCms.fireCmsEvent(
                new CmsEvent(
                    I_CmsEventListener.EVENT_FLEX_CACHE_CLEAR,
                    Collections.<String, Object> singletonMap(CmsFlexCache.CACHE_ACTION, new Integer(action))));
        } catch (Exception e) {
            setCommitErrors(Collections.singletonList((Throwable)e));
        }
    }
590648
public synchronized void flushUpdates() {

        Set<CmsUUID> updateIds = m_updateSet.removeAll();
        if (!updateIds.isEmpty()) {
            if (updateIds.contains(UPDATE_ALL)) {
                initialize();
            } else {
                Map<CmsUUID, CmsContainerConfigurationGroup> groups = loadFromIds(updateIds);
                CmsContainerConfigurationCacheState state = m_state.updateWithChangedGroups(groups);
                m_state = state;
            }
        }
    }
818172
private static void setCache(CmsObject cms, CmsXmlGroupContainer xmlGroupContainer, boolean keepEncoding) {

        if (xmlGroupContainer.getFile() instanceof I_CmsHistoryResource) {
            return;
        }
        boolean online = cms.getRequestContext().getCurrentProject().isOnlineProject();
        getCache().setCacheGroupContainer(
            getCache().getCacheKey(xmlGroupContainer.getFile().getStructureId(), keepEncoding),
            xmlGroupContainer,
            online);
    }
764285
public void flushMessageCache() {

        // clear the cached message objects
        m_messages = new HashMap<Locale, CmsWorkplaceMessages>();
        if (LOG.isDebugEnabled()) {
            try {
                throw new RuntimeException("Tracing exception");
            } catch (Exception e) {
                LOG.info("Tracing call to CmsWorkplaceManager.flushMessageCache method.", e);
            }
        }
    }
493872
protected void updateCache(@Nonnull Job<?,?> job, @Nullable Run<?,?> b) {
        final int n = b==null ? RESOLVES_TO_NONE : b.getNumber();

        File cache = getPermalinkFile(job);
        cache.getParentFile().mkdirs();

        try {
            String target = String.valueOf(n);
            if (b != null && !new File(job.getBuildDir(), target).exists()) {
                // (re)create the build Number->Id symlink
                Util.createSymlink(job.getBuildDir(),b.getId(),target,TaskListener.NULL);
            }
            writeSymlink(cache, target);
        } catch (IOException | InterruptedException e) {
            LOGGER.log(Level.WARNING, "Failed to update "+job+" "+getId()+" permalink for " + b, e);
            cache.delete();
        }
    }
1299405
private void updateMemcachedReadInstancesByZone() {
        for (ServerGroup serverGroup : memcachedInstancesByServerGroup.keySet()) {
            final BooleanProperty isZoneInWriteOnlyMode = writeOnlyFastPropertyMap.get(serverGroup);
            if (isZoneInWriteOnlyMode.get().booleanValue()) {
                if (memcachedReadInstancesByServerGroup.containsKey(serverGroup)) {
                	EVCacheMetricsFactory.increment(_appName, null, serverGroup.getName(), _appName + "-" + serverGroup.getName() + "-WRITE_ONLY");
                    memcachedReadInstancesByServerGroup.remove(serverGroup);
                }
            } else {
                if (!memcachedReadInstancesByServerGroup.containsKey(serverGroup)) {
                	EVCacheMetricsFactory.increment(_appName, null, serverGroup.getName(), _appName + "-" + serverGroup.getName() + "-READ_ENABLED");
                    memcachedReadInstancesByServerGroup.put(serverGroup, memcachedInstancesByServerGroup.get(serverGroup));
                }
            }

            // if we lose over 50% of instances put that zone in writeonly mode.
            final List<EVCacheClient> clients = memcachedReadInstancesByServerGroup.get(serverGroup);
            if (clients != null && !clients.isEmpty()) {
                final EVCacheClient client = clients.get(0);
                if (client != null) {
                    final EVCacheConnectionObserver connectionObserver = client.getConnectionObserver();
                    if (connectionObserver != null) {
                        final int activeServerCount = connectionObserver.getActiveServerCount();
                        final int inActiveServerCount = connectionObserver.getInActiveServerCount();
                        if (inActiveServerCount > activeServerCount) {
                            memcachedReadInstancesByServerGroup.remove(serverGroup);
                        }
                    }
                }
            }
        }

        if (memcachedReadInstancesByServerGroup.size() != memcachedFallbackReadInstances.getSize()) {
            memcachedFallbackReadInstances = new ServerGroupCircularIterator(memcachedReadInstancesByServerGroup.keySet());

            Map<String, Set<ServerGroup>> readServerGroupByZoneMap = new ConcurrentHashMap<String, Set<ServerGroup>>();
            for (ServerGroup serverGroup : memcachedReadInstancesByServerGroup.keySet()) {
                Set<ServerGroup> serverGroupList = readServerGroupByZoneMap.get(serverGroup.getZone());
                if (serverGroupList == null) {
                    serverGroupList = new HashSet<ServerGroup>();
                    readServerGroupByZoneMap.put(serverGroup.getZone(), serverGroupList);
                }
                serverGroupList.add(serverGroup);
            }

            Map<String, ServerGroupCircularIterator> _readServerGroupByZone = new ConcurrentHashMap<String, ServerGroupCircularIterator>();
            for (Entry<String, Set<ServerGroup>> readServerGroupByZoneEntry : readServerGroupByZoneMap.entrySet()) {
                _readServerGroupByZone.put(readServerGroupByZoneEntry.getKey(), new ServerGroupCircularIterator(
                        readServerGroupByZoneEntry.getValue()));
            }
            this.readServerGroupByZone = _readServerGroupByZone;
            localServerGroupIterator = readServerGroupByZone.get(_zone);
        }
    }
758461
public void update(Date lastScheduledExecutionTime, Date lastActualExecutionTime, Date lastCompletionTime) {
        this.lastScheduledExecutionTime = lastScheduledExecutionTime;
        this.lastActualExecutionTime = lastActualExecutionTime;
        this.lastCompletionTime = lastCompletionTime;
    }
996971
public void onContentChange() {

        Scheduler.get().scheduleDeferred(new ScheduledCommand() {

            public void execute() {

                Widget parent = getParent();
                while (parent != null) {
                    if (parent instanceof CmsGalleryDialog) {
                        ((CmsGalleryDialog)parent).updateSizes();
                        parent = null;
                    } else {
                        parent = parent.getParent();
                    }
                }
            }
        });
    }