generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests will come later as part of a larger testing effort
- Loading branch information
1 parent
7b6a421
commit c5b3687
Showing
5 changed files
with
129 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
java-runtime/ftl-runtime/runtime/src/main/java/xyz/block/ftl/LeaseClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package xyz.block.ftl; | ||
|
||
import java.time.Duration; | ||
|
||
/** | ||
* Client that can be used to acquire a FTL lease. If the lease cannot be acquired a {@link LeaseFailedException} is thrown. | ||
*/ | ||
public interface LeaseClient { | ||
|
||
void acquireLease(Duration duration, String... keys) throws LeaseFailedException; | ||
} |
26 changes: 26 additions & 0 deletions
26
java-runtime/ftl-runtime/runtime/src/main/java/xyz/block/ftl/LeaseFailedException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package xyz.block.ftl; | ||
|
||
/** | ||
* Checked exception that is thrown when a lease cannot be acquired | ||
*/ | ||
public class LeaseFailedException extends Exception { | ||
|
||
public LeaseFailedException() { | ||
} | ||
|
||
public LeaseFailedException(String message) { | ||
super(message); | ||
} | ||
|
||
public LeaseFailedException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
public LeaseFailedException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
public LeaseFailedException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { | ||
super(message, cause, enableSuppression, writableStackTrace); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters