generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13c8ca7
commit 4b84c0f
Showing
8 changed files
with
178 additions
and
60 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
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
19 changes: 19 additions & 0 deletions
19
java-runtime/ftl-runtime/deployment/src/main/java/xyz/block/ftl/deployment/RetryRecord.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,19 @@ | ||
package xyz.block.ftl.deployment; | ||
|
||
import org.jboss.jandex.AnnotationInstance; | ||
|
||
public record RetryRecord(int count, String minBackoff, String maxBackoff, String catchModule, String catchVerb) { | ||
|
||
public static RetryRecord fromJandex(AnnotationInstance nested, String currentModuleName) { | ||
return new RetryRecord( | ||
nested.value("count") != null ? nested.value("count").asInt() : 0, | ||
nested.value("minBackoff") != null ? nested.value("minBackoff").asString() : "", | ||
nested.value("maxBackoff") != null ? nested.value("maxBackoff").asString() : "", | ||
nested.value("catchModule") != null ? nested.value("catchModule").asString() : currentModuleName, | ||
nested.value("catchVerb") != null ? nested.value("catchVerb").asString() : ""); | ||
} | ||
|
||
public boolean isEmpty() { | ||
return count == 0 && minBackoff.isEmpty() && maxBackoff.isEmpty() && catchVerb.isEmpty(); | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
java-runtime/ftl-runtime/runtime/src/main/java/xyz/block/ftl/GeneratedRef.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; | ||
|
||
/** | ||
* Indicates that the class was generated from an external module. | ||
*/ | ||
public @interface GeneratedRef { | ||
|
||
String name(); | ||
|
||
String module(); | ||
} |
20 changes: 20 additions & 0 deletions
20
java-runtime/ftl-runtime/runtime/src/main/java/xyz/block/ftl/Retry.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,20 @@ | ||
package xyz.block.ftl; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ ElementType.METHOD }) | ||
public @interface Retry { | ||
int count() default 0; | ||
|
||
String minBackoff() default ""; | ||
|
||
String maxBackoff() default ""; | ||
|
||
String catchModule() default ""; | ||
|
||
String catchVerb() default ""; | ||
} |
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