-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Koboo/async
Async
- Loading branch information
Showing
19 changed files
with
369 additions
and
31 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
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,6 @@ | ||
package eu.koboo.en2do.internal; | ||
|
||
public interface MethodCallable { | ||
|
||
Object 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
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
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
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
15 changes: 15 additions & 0 deletions
15
src/main/java/eu/koboo/en2do/internal/exception/methods/MethodInvalidAsyncNameException.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,15 @@ | ||
package eu.koboo.en2do.internal.exception.methods; | ||
|
||
import eu.koboo.en2do.repository.methods.async.Async; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
public class MethodInvalidAsyncNameException extends Exception { | ||
|
||
public MethodInvalidAsyncNameException(Method method, Class<?> repoClass) { | ||
super("Methods, which start with the keyword \"async\" are not allowed in repository, except the predefined methods " + | ||
"of the repository itself. If you want to create \"async\" methods, just annotate any method with " + Async.class + | ||
" and encapsulate the return type in a CompletableFuture<T>. Invalid method is \"" + method.getName() + "\"" + | ||
" in repository " + repoClass.getName()); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...ain/java/eu/koboo/en2do/internal/exception/methods/MethodInvalidAsyncReturnException.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,14 @@ | ||
package eu.koboo.en2do.internal.exception.methods; | ||
|
||
import eu.koboo.en2do.repository.methods.async.Async; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
public class MethodInvalidAsyncReturnException extends Exception { | ||
|
||
public MethodInvalidAsyncReturnException(Method method, Class<?> repoClass) { | ||
super("Methods, which are annotated with " + Async.class + " have to return a CompletableFuture<T> with their " + | ||
" encapsulate return type as T. Invalid method is \"" + method.getName() + "\"" + | ||
" in repository " + repoClass.getName()); | ||
} | ||
} |
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
Oops, something went wrong.