public ActiveExecution lock ( String id ) throws Exception { LOGGER . debug ( "locking {}" , id ) ; if ( ! myLocks . contains ( id ) ) { if ( locking . acquire ( id , null ) ) { myLocks . add ( id ) ; ActiveExecution ae = new ActiveExecution ( ) ; ae . setMigrationJobId ( id ) ; ae . set_id ( id ) ; ae . setStartTime ( new Date ( ) ) ; return ae ; } } return null ; }
Attempts to lock a migration job . If successful return the migration job and the active execution