Skip to content

Feature/osgi type registry#7

Open
mnmercer wants to merge 3 commits intomainfrom
feature/osgi-type-registry
Open

Feature/osgi type registry#7
mnmercer wants to merge 3 commits intomainfrom
feature/osgi-type-registry

Conversation

@mnmercer
Copy link
Copy Markdown
Contributor

Generated by Claude, but makes the library compatible with OSGi consumers.

mnmercer and others added 3 commits January 31, 2026 21:35
This commit introduces a new approach to handling ORM type registration in
OSGi environments that avoids the race conditions inherent in dynamic service
discovery patterns.

Key additions:

1. TypeMetadata interface (owl-orm-api)
   - Provides metadata about generated OWL ORM types
   - Includes type IRI, parent type IRIs, and hierarchy depth
   - Computed statically at code generation time

2. TypeRegistry interface (owl-orm-api)
   - Central registry for TypeMetadata instances
   - Supports lookup by Class, IRI, or String
   - Provides sorted lookups (most specific first) for type hierarchy queries

3. SimpleTypeMetadata/SimpleTypeRegistry (owl-orm-engine)
   - Thread-safe implementations using ConcurrentHashMap
   - Support for source-based unregistration (for bundle tracking)

4. OsgiTypeRegistry (owl-orm-osgi)
   - OSGi service component using BundleTracker
   - Discovers TypeMetadata via ServiceLoader from bundle classloaders
   - Registers types during bundle STARTING phase before services activate

5. OsgiThingFactory (owl-orm-osgi)
   - OSGi service providing ThingFactory + type hierarchy operations
   - Methods matching Mobi OrmFactoryRegistry API patterns

6. Code generator updates (owl-orm-generate)
   - Generates TypeMetadata implementation classes for each OWL class
   - Generates META-INF/services file for ServiceLoader discovery

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…multiple owl:Ontology definitions in the same file. Also added fallback logic to use the ontology file name if there is no label on the owl:Ontology object itself.
…basic package to fix OSGi runtime errors. Fixed some logic when referenced things are not present in the underlying model of a BaseThing and added equality and hashCode methods. Changed BaseThingFactory to use the type's class loader instead of the OwlOrmInvocationHandler's class loader. Made clearOut methods in OwlOrmInvocationHandler valid for functional and non-functional. Added _Resource methods for generated object properties to avoid merging models if necessary. Updated OwlOrmInvocationHandler methods that retrieve values to create a new Thing if one does nto exist in the underlying model. Updated GeneratingOntology to ensure all transitive parents are considered. Fixed where TypeMetadata is written to for OSGi bundle loading.
@mnmercer mnmercer requested a review from bdgould February 27, 2026 16:26
@mnmercer mnmercer self-assigned this Feb 27, 2026
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