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 the
The following rules should enforce to use of a separate executor for executing dependent stages in a Hazelcast code:
ForkJoinPool#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
CompletionStagecreate a list of methods that have anAsynccounterpart - based on this list, filtering all their calls on the
CompletableFutureinstanceofobjects - checking that no non-Async methods versions are used
- checking that for Async methods the
Executorservice is specified - skipping methods that override
CompletableFuturebase class methods
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tngtech.archunit.lang.ArchCondition
com.tngtech.archunit.lang.ArchCondition.ConditionByPredicate<T extends com.tngtech.archunit.base.HasDescription & com.tngtech.archunit.core.domain.properties.HasSourceCodeLocation> -
Method Summary
Modifier and TypeMethodDescriptionvoidcheck(com.tngtech.archunit.core.domain.JavaClass item, com.tngtech.archunit.lang.ConditionEvents events) Methods inherited from class com.tngtech.archunit.lang.ArchCondition
and, as, finish, forSubtype, from, getDescription, init, or, toString
-
Method Details
-
check
public void check(com.tngtech.archunit.core.domain.JavaClass item, com.tngtech.archunit.lang.ConditionEvents events) - Specified by:
checkin classcom.tngtech.archunit.lang.ArchCondition<com.tngtech.archunit.core.domain.JavaClass>
-