Skip to content

Latest commit

 

History

History
62 lines (37 loc) · 1.66 KB

File metadata and controls

62 lines (37 loc) · 1.66 KB

Registry

Purpose

Registries store validated event classes after they have been classified into an event family.

The base contract, EventRegistryInterface, exposes only:

  • family()
  • register()
  • has()
  • all()

There is no removal API.

Lockable Registries

LockableEventRegistryInterface adds:

  • lock()
  • isLocked()

Once locked, a registry rejects further registrations with RegistryLockedException.

Concrete Registries

The package provides two concrete registries:

  • KernelEventRegistry for EventFamily::KernelState
  • ProcessEventRegistry for EventFamily::Process

The base implementation, AbstractLockableEventRegistry, enforces:

  • family segregation
  • duplicate protection
  • lock state checks

Registering a process event in the kernel registry, or the reverse, fails with EventFamilyMismatchException.

Additive-Only Behavior

ProcessEventRegistry implements AdditiveOnlyEventRegistryInterface. This expresses that process registries are open to additions but not designed for unregister semantics.

That additive-only behavior is reflected structurally:

  • registration is supported
  • removal is absent
  • tests assert the additive-only contract is advertised

Lifecycle Locking Model

The architecture distinguishes two phases:

  • kernel-state events are typically finalized earlier
  • process events may remain open longer for additive extension

The current implementation provides the locking mechanism but does not schedule those phases itself. The caller or integrating framework decides when each registry is locked.

Related: