Skip to content

Commit

Permalink
Allow the ScheduledExecutorService to be provided by the container
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Evans <[email protected]>
  • Loading branch information
tevans78 committed Aug 15, 2023
1 parent 554a48d commit 02df0c1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ release.conf
/bin/
.~lock.*.odg#
**.DS_Store
.vscode/
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2018, 2023 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand Down Expand Up @@ -86,14 +86,30 @@ public void shutdownEngine() {
if (engine != null) {
shutdownEngine(engine);
}
if (executorService != null) {
shutdownExecutorService(executorService);
}
}

/**
* Override this to provide a different ScheduledExecutorService
*/
protected ScheduledExecutorService createExecutorService() {
return Executors.newScheduledThreadPool(4);
}

/**
* Override this to customize the shutdown of a ScheduledExecutorService
*/
protected void shutdownExecutorService(ScheduledExecutorService executorService) {
executorService.shutdown();
}

@Factory
public Object[] allTests() {
engine = createEngine();
rs = createFactory();
executorService = Executors.newScheduledThreadPool(4);
executorService = createExecutorService();

ReactiveStreamsApiVerification apiVerification = new ReactiveStreamsApiVerification(rs);
ReactiveStreamsSpiVerification spiVerification =
Expand Down

0 comments on commit 02df0c1

Please sign in to comment.