Registered Kind vocabulary with family projection and type-implied kinds - #760
Merged
Conversation
…ied kinds Add org.jpos.util.Kind: the kinds jPOS core emits as LogEvent tags, each mapped to a severity family, plus format validation. Kinds are registered, not fixed: AuditLogEventProvider gains kinds(), AuditLogEventType gains an optional implied kind, and the registry merges core built-ins with every provider on the classpath, rejecting conflicting families. Log.createEvent(AuditLogEvent) and LogEvent(LogSource, AuditLogEvent) set the tag from the payload's registered type. Log level constants now reference Kind; values are unchanged. No emitter changes, no change to serialized output. Closes #759
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #759.
What
org.jpos.util.Kind: family constants, the 35 kinds core emits,Def,family(),kindOf()by type id and by payload,isValid(),isRegistered(),registered().AuditLogEventTypegains an optional third component, the kind the type implies. Two-argument constructor kept.AuditLogEventProvidergainsdefault kinds()so jPOS-EE modules and applications register kinds through the existing ServiceLoader SPI.AuditLogEventRegistrybuilt-ins declare their implied kinds (iso-session,lifecycle,deploy, ...) and exposetypeOf(String)/typeOf(Class).Log.createEvent(AuditLogEvent)andLogEvent(LogSource, AuditLogEvent)set the tag from the payload's registered type. No heuristic in the writers;new LogEvent()still meansinfo.Log.TRACE/DEBUG/INFO/WARN/ERROR/FATALreferenceKind; values unchanged.fatalis a registered kind.LogEventconstructors andLog.createLogEventdescribes the tag as a kind.Behaviour
No emitter changes and no change to emitted or serialized values. The registry loads lazily on first use, merges core with every provider, and throws on a conflicting family or on a type implying an unregistered kind. Families are extensible; javadoc discourages new ones.
Tests
KindTest(13 tests) covers every acceptance criterion in #759, including provider-registered kinds and families viaTestAuditLogEventProvider. Full:jpos:testand:jpos:javadocpass with no warnings.Follow-up
Core conformance sweep (rename the handful of non-conforming tags and switch the eight
AuditLogEventemission sites tocreateEvent) is a separate issue since it changes serialized output.