DefaultMethodContract

Contract for hand-written decorators and storage implementations over Wow SPI interfaces.

An SPI method with a default body is a fallback, for example EventStore.existsRequestId scans the whole stream. A decorator that inherits the fallback instead of forwarding the call silently bypasses the delegate's own (cheaper) implementation. inheritedDefaults lists every such inherited default so a test can require each decorator to override all of them.

Properties

Link copied to clipboard

Default members that return a constant classifier of the interface itself (the delegate returns the same value), so a decorator inherits them by design.

Functions

Link copied to clipboard
fun assertOnlyKnownGaps(types: Collection<Class<*>>, knownGaps: Map<String, String>, ignoredMembers: Set<String> = CONSTANT_CLASSIFIERS)

Fails when the inherited defaults of types differ from knownGaps (key = SimpleName.method(ParamTypes), value = the work item that removes the gap). A new gap fails the check, and so does a fixed gap that is still listed, so the known-gap list can only shrink.

Link copied to clipboard
fun concreteSubtypes(packageName: String, type: Class<*>, classLoader: ClassLoader = type.classLoader): List<Class<*>>

Lists the concrete classes under packageName (including sub-packages) that are assignable to type, loaded through classLoader. Supports directory and jar classpath entries.

Link copied to clipboard
fun inheritedDefaults(type: Class<*>, ignoredMembers: Set<String> = CONSTANT_CLASSIFIERS): List<String>

Returns SimpleName.member(ParamTypes) for every member with a default body, declared by a Wow interface (package me.ahoo.wow.), that type inherits without overriding it in a class of its own hierarchy.

fun inheritedDefaults(types: Collection<Class<*>>, ignoredMembers: Set<String> = CONSTANT_CLASSIFIERS): List<String>

Returns the inherited defaults of all types, see inheritedDefaults.