ShedLock is a distributed locking mechanism for scheduled tasks in Java environments. Not unlike a semaphore or mutex it uses an external data store (i.e. some sort of database) to acquire locks for preventing tasks from being executed more than once.
Prolific Java tutorial site Baeldung has a comprehensive Guide to ShedLock with Spring to get you started with this useful tool.