Skip to content

Commit 9b8a059

Browse files
committed
Add Windows frontend execution adapter
1 parent d6fdec0 commit 9b8a059

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package windows;
2+
3+
import java.util.Objects;
4+
import java.util.concurrent.CompletableFuture;
5+
import java.util.concurrent.CompletionStage;
6+
7+
/**
8+
* Windows-facing adapter for translating a received call into a controlled
9+
* Windows execution request. Transport code remains separate from execution
10+
* policy so HTTP, Telnet, named pipes, or other frontends can share it.
11+
*/
12+
public final class WindowsFrontendAdapter {
13+
private final WindowsExecution execution;
14+
15+
public WindowsFrontendAdapter(WindowsExecution execution) {
16+
this.execution = Objects.requireNonNull(execution, "execution");
17+
}
18+
19+
public CompletionStage<WindowsExecution.Result> accept(WindowsCall call) {
20+
Objects.requireNonNull(call, "call");
21+
return CompletableFuture.supplyAsync(() -> execution.execute(call));
22+
}
23+
}

0 commit comments

Comments
 (0)