File tree Expand file tree Collapse file tree
core-java-8/src/main/java/com/baeldung/forkjoin Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import java .util .List ;
66import java .util .concurrent .ForkJoinTask ;
77import java .util .concurrent .RecursiveAction ;
8+ import java .util .logging .Logger ;
89
910public class CustomRecursiveAction extends RecursiveAction {
1011
1112 private String workLoad = "" ;
12-
1313 private static final int THRESHOLD = 4 ;
1414
15+ private static Logger logger = Logger .getAnonymousLogger ();
16+
1517 public CustomRecursiveAction (String workLoad ) {
1618 this .workLoad = workLoad ;
1719 }
@@ -41,6 +43,7 @@ private Collection<CustomRecursiveAction> createSubtasks() {
4143 }
4244
4345 private void processing (String work ) {
44- work .toUpperCase ();
46+ String result = work .toUpperCase ();
47+ logger .info ("This result - (" + result + ") - was processed by " + Thread .currentThread ().getName ());
4548 }
4649}
You can’t perform that action at this time.
0 commit comments