@@ -1466,11 +1466,13 @@ <R> ActivityHandle<R> start(
14661466 * @return the activity result
14671467 * @throws ActivityFailedException if the activity failed, timed out, or was cancelled
14681468 */
1469- <R > R execute (
1469+ default <R > R execute (
14701470 String activityType ,
14711471 Class <R > resultClass ,
14721472 StartActivityOptions options ,
1473- @ Nullable Object ... args );
1473+ @ Nullable Object ... args ) {
1474+ return start (activityType , resultClass , options , args ).getResult ();
1475+ }
14741476
14751477 /**
14761478 * Starts a standalone activity and blocks until it completes, for generic result types.
@@ -1484,12 +1486,14 @@ <R> R execute(
14841486 * @return the activity result
14851487 * @throws ActivityFailedException if the activity failed, timed out, or was cancelled
14861488 */
1487- <R > R execute (
1489+ default <R > R execute (
14881490 String activityType ,
14891491 Class <R > resultClass ,
14901492 Type resultType ,
14911493 StartActivityOptions options ,
1492- @ Nullable Object ... args );
1494+ @ Nullable Object ... args ) {
1495+ return start (activityType , resultClass , resultType , options , args ).getResult ();
1496+ }
14931497
14941498 /**
14951499 * Starts a standalone activity and returns a future that completes when the activity does,
@@ -1513,11 +1517,13 @@ CompletableFuture<Void> executeAsync(
15131517 * @param <R> result type
15141518 * @return a future that resolves to the activity result
15151519 */
1516- <R > CompletableFuture <R > executeAsync (
1520+ default <R > CompletableFuture <R > executeAsync (
15171521 String activityType ,
15181522 Class <R > resultClass ,
15191523 StartActivityOptions options ,
1520- @ Nullable Object ... args );
1524+ @ Nullable Object ... args ) {
1525+ return start (activityType , resultClass , options , args ).getResultAsync ();
1526+ }
15211527
15221528 /**
15231529 * Starts a standalone activity and returns a future, for generic result types.
@@ -1530,12 +1536,14 @@ <R> CompletableFuture<R> executeAsync(
15301536 * @param <R> result type
15311537 * @return a future that resolves to the activity result
15321538 */
1533- <R > CompletableFuture <R > executeAsync (
1539+ default <R > CompletableFuture <R > executeAsync (
15341540 String activityType ,
15351541 Class <R > resultClass ,
15361542 Type resultType ,
15371543 StartActivityOptions options ,
1538- @ Nullable Object ... args );
1544+ @ Nullable Object ... args ) {
1545+ return start (activityType , resultClass , resultType , options , args ).getResultAsync ();
1546+ }
15391547
15401548 /**
15411549 * Returns an untyped handle to an existing standalone activity execution.
0 commit comments