private synchronized static void loadAll ( ) throws DaoManagerException { if ( setImpl == null ) { long implLastModifiedTime = impl . getLastModified ( ) ; if ( lastModified < implLastModifiedTime ) { Map < String , PropertyDescriptor > staticValues = impl . getAll ( ) ; // to avoid reading while cleaning synchronized ( cache ) { cache . clear ( ) ; cache . putAll ( staticValues ) ; } lastModified = System . currentTimeMillis ( ) ; notifyPropertiesChangedListers ( lastModified ) ; } } else { long implLastModifiedTime = impl . getLastModified ( ) ; long setImplLastModifiedTime = setImpl . getLastModified ( ) ; if ( lastModified < implLastModifiedTime || lastModified < setImplLastModifiedTime ) { Map < String , PropertyDescriptor > staticValues = impl . getAll ( ) ; Map < String , PropertyDescriptor > dynamicValues = setImpl . getAll ( ) ; // to avoid reading while cleaning synchronized ( cache ) { cache . clear ( ) ; cache . putAll ( staticValues ) ; cache . putAll ( dynamicValues ) ; } lastModified = System . currentTimeMillis ( ) ; notifyPropertiesChangedListers ( lastModified ) ; } } }
Thread exclusion zone .