Package com.hazelcast.test.archunit
Class CompletableFutureUsageCondition
- java.lang.Object
-
- com.tngtech.archunit.lang.ArchCondition<com.tngtech.archunit.core.domain.JavaClass>
-
- com.hazelcast.test.archunit.CompletableFutureUsageCondition
-
public class CompletableFutureUsageCondition extends com.tngtech.archunit.lang.ArchCondition<com.tngtech.archunit.core.domain.JavaClass>
Hazelcast internal callbacks shouldn't use theForkJoinPool#commonPool
, due to the risk of blocking Hazelcast progress by other misbehaving applications/libraries.
The following rules should enforce to use of a separate executor for executing dependent stages in a Hazelcast code:- from
CompletionStage
create a list of methods that have anAsync
counterpart - based on this list, filtering all their calls on the
CompletableFuture
instanceof
objects - checking that no non-Async methods versions are used
- checking that for Async methods the
Executor
service is specified - skipping methods that override
CompletableFuture
base class methods
- from
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
check(com.tngtech.archunit.core.domain.JavaClass item, com.tngtech.archunit.lang.ConditionEvents events)
-