@Override
    public CmsFile writeFile(CmsObject cms, CmsSecurityManager securityManager, CmsFile resource) throws CmsException {

        String savingStr = (String)cms.getRequestContext().getAttribute(CmsContentService.ATTR_EDITOR_SAVING);
        CmsFile file = super.writeFile(cms, securityManager, resource);
        // Formatter configuration cache updates are asynchronous, but to be able to reload a container page
        // element in the page editor directly after editing it and having it reflect the changes made by the user
        // requires that we wait on a wait handle for the formatter cache.

        if (Boolean.valueOf(savingStr).booleanValue()) {
            CmsWaitHandle waitHandle = OpenCms.getADEManager().addFormatterCacheWaitHandle(false);
            waitHandle.enter(10000);
        }
        return file;
    }
@ Override public CmsFile writeFile ( CmsObject cms , CmsSecurityManager securityManager , CmsFile resource ) throws CmsException { String savingStr = ( String ) cms . getRequestContext ( ) . getAttribute ( CmsContentService . ATTR_EDITOR_SAVING ) ; CmsFile file = super . writeFile ( cms , securityManager , resource ) ; if ( Boolean . valueOf ( savingStr ) . booleanValue ( ) ) { CmsWaitHandle waitHandle = OpenCms . getADEManager ( ) . addFormatterCacheWaitHandle ( false ) ; waitHandle . enter ( 10000 ) ; } return file ; }
@see org.opencms.file.types.CmsResourceTypeXmlContent#writeFile(org.opencms.file.CmsObject, org.opencms.db.CmsSecurityManager, org.opencms.file.CmsFile)

After writing the file, this method waits until the formatter configuration is update the next time.