This repository has been archived by the owner on Sep 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Execute callables within Gumshoe managed context
Addresses issue #26 to give callback interfaces to be executed within a Gumshoe managed context. The context will start, execute the callable, finish the context (or fail it if exception) then return result (or propagate exception). Two interfaces are supported -- the standard lib Callable interface when you care about a return value and the Gumshoe provided VoidCallable interface when you don't care about a return value.
- Loading branch information
Lance Woodson
committed
Aug 25, 2016
1 parent
cac62a6
commit df9f66e
Showing
4 changed files
with
143 additions
and
0 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
13 changes: 13 additions & 0 deletions
13
java/src/main/java/com/bazaarvoice/gumshoe/InContextException.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,13 @@ | ||
package com.bazaarvoice.gumshoe; | ||
|
||
/** | ||
* Exception raised when an exception happens within a context. | ||
* | ||
* @author lance.woodson | ||
* | ||
*/ | ||
public class InContextException extends RuntimeException { | ||
public InContextException(Exception cause) { | ||
super(cause); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
java/src/main/java/com/bazaarvoice/gumshoe/VoidCallable.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 com.bazaarvoice.gumshoe; | ||
|
||
/** | ||
* Interface of objects that can be invoked within a context | ||
* | ||
* @author lance.woodson | ||
* | ||
*/ | ||
public interface VoidCallable { | ||
void call() throws Exception; | ||
} |
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