package Ġprojekt or . schedule Ċ Ċ import Ġnet . javac r umb s . s hed lock . core . Default Lock ing Task Executor Ċ import Ġnet . javac r umb s . s hed lock . core . Lock Configuration Ċ import Ġnet . javac r umb s . s hed lock . provider . j db ct emplate . Jdbc Template Lock Provider Ċ import Ġjava . time . Instant Ċ import Ġjavax . sql . DataSource Ċ Ċ class ĠScheduler Lock ( dataSource : ĠDataSource ) Ġ{ ĊĠĠĠ Ġprivate Ġval Ġlock Provider Ġ= ĠJdbc Template Lock Provider ( dataSource ) ĊĠĠĠ Ġprivate Ġval Ġexecutor Ġ= ĠDefault Lock ing Task Executor ( lock Provider ) ĊĊĠĠĠ Ġfun Ġexecute With Lock ( run nable : ĠRunnable , Ġlock Config : ĠScheduler Lock Config ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlock At Most Until : ĠInstant Ġ= ĠInstant . now (). plus Seconds ( lock Config . lock Minutes Ġ* Ġ 6 0 ) ĊĠĠĠĠĠĠĠ Ġexecutor . execute With Lock ( run nable , ĠLock Configuration ( lock Config . lock Name , Ġlock At Most Until )) ĊĠĠĠ Ġ} Ċ } Ċ Ċ data Ġclass ĠScheduler Lock Config ( val Ġlock Minutes : ĠLong , Ġval Ġlock Name : ĠString ) Ċ