Reference Counted Context for Lightweight CDI Lifecycle Management

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Java EE environments are not lightweight enough for modern microservices platforms, making it difficult to migrate Java EE resources and implement Java Persistence Architecture (JPA) specifications without relying on traditional application servers, as built-in CDI mechanisms cannot realize all required lifecycles for JPA objects.

Innovation Solution

A Reference Counted Context and its accompanying portable extension manage CDI object lifecycles by tracking references and destroying objects when their count reaches zero, allowing for the implementation of JPA and other specifications in a lightweight CDI ecosystem without relying on application servers, using a static ThreadLocal map to cache instances and decrement reference counts accordingly.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If traditional application servers are used to manage CDI object lifecycles, then JPA specifications can be fully implemented, but the system becomes too heavy and not suitable for modern microservices platforms

Engineering Contradiction:
ImproveJPA specification implementationVSAvoidsystem weight
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent extracts the lifecycle management functionality from traditional heavy application servers and implements it as a lightweight portable extension within the CDI ecosystem. The ReferenceCountedContext and its accompanying portable extension isolate the essential lifecycle management capabilities, separating them from the bulky application server infrastructure, thereby enabling JPA specification implementation without the overhead of traditional application servers.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent introduces a portable extension as an intermediary layer between the CDI container and JPA components. This portable extension acts as a mediator that implements reference counting logic and lifecycle management, bridging the gap between lightweight CDI and full JPA specification requirements without needing traditional application servers.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Extent of automation

If reference counting is implemented to manage object lifecycles, then object destruction can be automated when no longer needed, but tracking all references adds complexity

Engineering Contradiction:
Improveautomatic object destructionVSAvoidreference tracking mechanism
Core Design Contradiction:
Extent of automationVSDevice complexity

Solution Approach 1:

The patent implements a feedback mechanism through reference counting, where the system continuously monitors the number of active references to each managed object. When the reference count drops to zero, the system automatically triggers object destruction. This feedback loop enables automated lifecycle management without manual intervention, balancing automation benefits against the complexity of maintaining the reference tracking infrastructure.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS11314527B2System and method for managing reference-counted lifecycles of contexts and dependency injection (CDI) components
Publication Date: 2022.04.26 ORACLE INT CORP
  • US11314527B2 patent drawing
  • US11314527B2 patent drawing
  • US11314527B2 patent drawing

AI summary

Described herein are systems and methods for managing reference counted lifecycles of contexts and dependency injection (CDI) components. The systems and methods described herein provide new constructs that allow for managing and monitoring CDI object lifecycles. Put together, these constructs permit specifications (e.g., JPA) to be fully implemented in a lightweight CDI ecosystem without reliance on typical application servers.