Skip to content

Integrate Runtime into DefaultContext#660

Merged
eitch merged 3 commits into
Pi4J:developfrom
kobjects:develop
Jun 18, 2026
Merged

Integrate Runtime into DefaultContext#660
eitch merged 3 commits into
Pi4J:developfrom
kobjects:develop

Conversation

@stefanhaustein

@stefanhaustein stefanhaustein commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

It was mostly just delegating to other entities anyway -- adding a layer of indirection that did not seem to have much of a clear purpose on its own

I have tried to strictly inline only -- there shouldn't be any semantic changes.

@stefanhaustein stefanhaustein requested a review from eitch June 17, 2026 21:40
@stefanhaustein stefanhaustein changed the title Integrate runtime into DefaultContext Integrate Runtime into DefaultContext Jun 17, 2026
@FDelporte FDelporte requested a review from Copilot June 18, 2026 06:15
Comment thread pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContext.java Outdated
Comment thread pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContext.java

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR inlines the former com.pi4j.runtime.Runtime responsibilities into DefaultContext, removing the dedicated runtime layer and associated provider wrappers so the Context directly owns initialization/shutdown, plugin discovery, provider lifecycle, registry, events, and task execution.

Changes:

  • Removed the standalone Runtime abstraction and related provider wrapper interfaces/classes.
  • Moved runtime-managed provider/registry implementations under com.pi4j.context.impl.
  • Inlined runtime initialization/shutdown logic (plugins/providers/events/executors/registry) into DefaultContext.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pi4j-core/src/main/java/com/pi4j/runtime/Runtime.java Deleted; runtime lifecycle responsibilities are moved into DefaultContext.
pi4j-core/src/main/java/com/pi4j/provider/impl/RuntimeProviders.java Deleted; runtime-specific provider lifecycle interface removed.
pi4j-core/src/main/java/com/pi4j/provider/impl/DefaultProviders.java Deleted; provider delegation wrapper removed.
pi4j-core/src/main/java/com/pi4j/context/impl/MutableRegistry.java Package adjusted to match location under context.impl (runtime-managed registry now context-managed).
pi4j-core/src/main/java/com/pi4j/context/impl/MutableProviders.java Moved/renamed and reworked to be context-managed (MutableProviders) rather than runtime-managed.
pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContext.java Major changes: inlines runtime initialization/shutdown, plugin/provider lifecycle, registry ownership, event managers, executor pool, and shutdown hook.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContext.java Outdated
Comment thread pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContext.java Outdated
Comment thread pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContext.java Outdated
Comment thread pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContext.java Outdated
Comment thread pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContext.java Outdated
Comment thread pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContext.java

@eitch eitch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise looks good

Comment thread pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContext.java
Comment thread pi4j-core/src/main/java/com/pi4j/context/impl/DefaultContext.java
@eitch eitch merged commit 7351a6b into Pi4J:develop Jun 18, 2026
4 checks passed
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.

4 participants