-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
44 changed files
with
3,089 additions
and
2,334 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ hs_err_pid* | |
|
||
# Directories | ||
target/ | ||
test-results-native/ | ||
|
||
# OS generating files | ||
.DS_Store | ||
|
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,40 @@ | ||
/* | ||
* AsyncGroup class. | ||
* Copyright (C) 2023 Takayuki Sato. All Rights Reserved. | ||
*/ | ||
package com.github.sttk.sabi; | ||
|
||
import com.github.sttk.sabi.errs.Err; | ||
|
||
import java.util.Map; | ||
import java.util.HashMap; | ||
|
||
/** | ||
* {@code AsyncGroup} is the inferface to execute added {@link Runner}(s) | ||
* asynchronously. | ||
* <p> | ||
* The method Add is to add target {@link Runner}(s). | ||
* This interface is used as an argument of {@link DaxSrc#setup}, {@link | ||
* DaxConn#commit}, and {@link DaxConn#rollback}. | ||
*/ | ||
public interface AsyncGroup { | ||
|
||
/** | ||
* {@code RunnerFailed} is an error reason which indicates that a {@link | ||
* Runner} failed. | ||
*/ | ||
record RunnerFailed() {} | ||
|
||
/** | ||
* {@code RunnerInterrupted} is an error reason which indicates that a {@link | ||
* Runner}'s thread is interrupted. | ||
*/ | ||
record RunnerInterrupted() {} | ||
|
||
/** | ||
* Adds a runner to be run asynchronously. | ||
* | ||
* @param runner A {@link Runner} object. | ||
*/ | ||
void add(Runner runner); | ||
} |
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,30 @@ | ||
/* | ||
* Dax class. | ||
* Copyright (C) 2022-2023 Takayuki Sato. All Rights Reserved. | ||
*/ | ||
package com.github.sttk.sabi; | ||
|
||
import com.github.sttk.sabi.errs.Err; | ||
|
||
/** | ||
* Dax is the interface for a set of data access methods. | ||
* | ||
* This interface is inherited by Dax implementations for data stores, and | ||
* each Dax implementation defines data access methods to each data store. | ||
* In data access methods, {@link DaxConn} instances conected to data stores | ||
* can be obtained with {@link #getDaxConn} method. | ||
*/ | ||
public interface Dax { | ||
|
||
/** | ||
* Gets a DaxConn instance associated with the argument name. | ||
* The name is same as what was registered with DaxSrc using {@link | ||
* Sabi#uses} method. | ||
* | ||
* @param <C> The type of a {@link DaxConn}. | ||
* @param name A name of a {@link DaxConn}. | ||
* @return A {@link DaxConn} instance. | ||
* @throws Err If getting a {@link DaxConn} fails. | ||
*/ | ||
<C extends DaxConn> C getDaxConn(String name) throws Err; | ||
} |
Oops, something went wrong.