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);
        }
    }
public void performUpdate ( ) { 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 ) ) { reload ( ) ; } else { Map < CmsUUID , I_CmsFormatterBean > formattersToUpdate = Maps . newHashMap ( ) ; for ( CmsUUID structureId : copiedIds ) { I_CmsFormatterBean formatterBean = readFormatter ( structureId ) ; formattersToUpdate . put ( structureId , formatterBean ) ; } m_state = m_state . createUpdatedCopy ( formattersToUpdate ) ; } for ( CmsWaitHandle handle : waitHandles ) { handle . release ( ) ; } } catch ( Exception e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } }
The method called by the scheduled update action to update the cache.<p>