private void lockContext ( String contextId ) throws EKBConcurrentException { if ( mode == ContextLockingMode . DEACTIVATED ) { return ; } synchronized ( activeWritingContexts ) { if ( activeWritingContexts . contains ( contextId ) ) { throw new EKBConcurrentException ( "There is already a writing process active in the context." ) ; } activeWritingContexts . add ( contextId ) ; } }
If the context locking mode is activated this method locks the given context for writing operations . If this context is already locked an EKBConcurrentException is thrown .