public < R > R accessContext ( ContextAccess < C , R > access ) { contextLock . lock ( ) ; try { return access . access ( context ) ; } finally { contextLock . unlock ( ) ; } }
Provides thread save access to the context object . ContextAccess . access method is called inside a lock to prevent concurrent modification to the object .