Class EntryPoints
java.lang.Object
org.springframework.modulith.core.EntryPoints
- All Implemented Interfaces:
Iterable<EntryPoints.EntryPoint>
All
EntryPoints.EntryPoints of an ApplicationModule, i.e. methods or constructors that can trigger module
behavior from the outside.
There are two, independent ways for a method to qualify:
- It's publicly accessible and declared on a type exposed by the module, i.e. reachable via a regular Java method call from other modules.
- It's invoked directly by framework infrastructure — an HTTP handler method, an application event listener, or a message listener — regardless of whether its declaring type is exposed, as those are triggered independently of the module's named interfaces.
- Since:
- 2.2
- Author:
- Oliver Drotbohm
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classA method or constructor that forms an entry point into theApplicationModulethat thisEntryPointsinstance was created for, i.e. code that can trigger module behavior from the outside, either because it's part of the module's exposed, public API, or because some framework infrastructure invokes it directly. -
Method Summary
Modifier and TypeMethodDescription(package private) booleancontains(com.tngtech.archunit.core.domain.JavaCodeUnit unit) Returns whether the givenJavaCodeUnitforms one of theseEntryPoints.EntryPoints.(package private) <X extends TypeAware>
MultiValueMap<EntryPoints.EntryPoint,X> Filters the givenTypeAwarecandidates down to the ones actually (transitively) reachable from one of theseEntryPoints.EntryPoints, returning theEntryPoints.EntryPoints found, each paired with the candidate(s) it potentially triggers the creation of.(package private) EntryPointsfilter(com.tngtech.archunit.core.domain.JavaClass type) Returns a newEntryPointscontaining only the ones declared on the given type.(package private) EntryPointsReturns a newEntryPointscontaining only the ones declared on the given type.iterator()(package private) static EntryPointsof(ApplicationModule module) Calculates theEntryPointsof the givenApplicationModule.(package private) Stream<EntryPoints.EntryPoint>stream()Returns aStreamof allEntryPoints.EntryPoints.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
of
Calculates theEntryPointsof the givenApplicationModule.- Parameters:
module- must not be null.- Returns:
- will never be null.
-
contains
boolean contains(com.tngtech.archunit.core.domain.JavaCodeUnit unit) Returns whether the givenJavaCodeUnitforms one of theseEntryPoints.EntryPoints.- Parameters:
unit- must not be null.
-
stream
Stream<EntryPoints.EntryPoint> stream()Returns aStreamof allEntryPoints.EntryPoints.- Returns:
- will never be null.
-
filter
Returns a newEntryPointscontaining only the ones declared on the given type.- Parameters:
type- must not be null.- Returns:
- will never be null.
-
filter
Returns a newEntryPointscontaining only the ones declared on the given type.- Parameters:
type- must not be null.- Returns:
- will never be null.
-
discover
Filters the givenTypeAwarecandidates down to the ones actually (transitively) reachable from one of theseEntryPoints.EntryPoints, returning theEntryPoints.EntryPoints found, each paired with the candidate(s) it potentially triggers the creation of.For each candidate's
TypeAware.getCreations(), we walk up the call graph viaJavaAccess.getOrigin()and its callers, recording every method along the way that forms one of theseEntryPoints.EntryPoints as a potential trigger.This is a first, deliberately simple cut of the algorithm used to select which of the discovered entry points are eventually surfaced. It is expected to evolve.
- Type Parameters:
X- the type of candidate.- Parameters:
candidates- must not be null.- Returns:
- will never be null.
-
iterator
- Specified by:
iteratorin interfaceIterable<EntryPoints.EntryPoint>
-