protected boolean lockJobIfNeeded ( ) { try { if ( job . isExclusive ( ) ) { processEngineConfiguration . getCommandExecutor ( ) . execute ( new LockExclusiveJobCmd ( job ) ) ; } } catch ( Throwable lockException ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Could not lock exclusive job. Unlocking job so it can be acquired again. Catched exception: " + lockException . getMessage ( ) ) ; } // Release the job again so it can be acquired later or by another node unacquireJob ( ) ; return false ; } return true ; }
Returns true if lock succeeded or no lock was needed . Returns false if locking was unsuccessfull .