Skip to content

Registered Kind vocabulary with family projection and type-implied kinds - #760

Merged
ar merged 1 commit into
mainfrom
feature/issue-759-kind
Sep 2, 2026
Merged

Registered Kind vocabulary with family projection and type-implied kinds#760
ar merged 1 commit into
mainfrom
feature/issue-759-kind

Conversation

@ar

@ar ar commented Sep 2, 2026

Copy link
Copy Markdown
Member

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().
  • AuditLogEventType gains an optional third component, the kind the type implies. Two-argument constructor kept.
  • AuditLogEventProvider gains default kinds() so jPOS-EE modules and applications register kinds through the existing ServiceLoader SPI.
  • AuditLogEventRegistry built-ins declare their implied kinds (iso-session, lifecycle, deploy, ...) and expose typeOf(String) / typeOf(Class).
  • Log.createEvent(AuditLogEvent) and LogEvent(LogSource, AuditLogEvent) set the tag from the payload's registered type. No heuristic in the writers; new LogEvent() still means info.
  • Log.TRACE/DEBUG/INFO/WARN/ERROR/FATAL reference Kind; values unchanged. fatal is a registered kind.
  • Javadoc on LogEvent constructors and Log.createLogEvent describes 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 via TestAuditLogEventProvider. Full :jpos:test and :jpos:javadoc pass with no warnings.

Follow-up

Core conformance sweep (rename the handful of non-conforming tags and switch the eight AuditLogEvent emission sites to createEvent) is a separate issue since it changes serialized output.

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant