Skip to content

docs: rewrite IMPLEMENTING_JRES.md for BaseJRE pattern#1339

Merged
stokpop merged 6 commits into
cloudfoundry:mainfrom
stokpop:docs/implementing-jres-basejre
Jul 9, 2026
Merged

docs: rewrite IMPLEMENTING_JRES.md for BaseJRE pattern#1339
stokpop merged 6 commits into
cloudfoundry:mainfrom
stokpop:docs/implementing-jres-basejre

Conversation

@stokpop

@stokpop stokpop commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

What changed

  • Removed: manual boilerplate implementation guides (OpenJDK/Zulu/IBM step-by-step with full code listings), redundant "Best Practices" and "Common Patterns" sections (now handled by BaseJRE automatically)
  • Added: BaseJRE variation points table, 3-step implementation guide, lean examples for standard/exact-dir/error-hint patterns
  • Updated: Java 21 in all examples; memory calculator config now shows JBP_CONFIG_<JRE>_JRE as preferred (covers stack_threads, class_count, headroom) with a note that MEMORY_CALCULATOR_* env vars override but don't cover class_count
  • Kept lean: helper function reference table, memory calculator runtime output, JVMKill + heap dump volume service, troubleshooting section, summary, See Also cross-references

Related

Follows #1288 (BaseJRE refactor that this doc now describes)

Please review if complete or must be extended.

stokpop added 4 commits June 26, 2026 14:59
PR cloudfoundry#1288 refactored all standard JREs to embed BaseJRE (14 lines each),
but the guide still showed the old 100+ line manual implementation with
explicit Supply()/Finalize() boilerplate.

Rewrite to document the actual pattern: newBaseJRE() + optional
extraFinalizeOpts. Removes sections on manual memory calculator and
JVMKill integration (now internal to BaseJRE). Adds variation-point
table and examples for all three patterns (standard, exact-dir, error-hint).
…ooting

Rebalances the IMPLEMENTING_JRES.md rewrite — adds back lean sections for:
- Helper function reference table (GetJREVersion, WriteJavaOpts, etc.)
- profile.d script output example
- Memory calculator: runtime output and user customization env vars
- JVMKill: purpose, heap dump / volume service binding
- Troubleshooting: JAVA_HOME, memory calculator, version resolution
- Use Java 21 in version examples and profile.d output
- Prefer JBP_CONFIG_<JRE>_JRE for memory calculator config (covers stack_threads, class_count, headroom)
- Note MEMORY_CALCULATOR_* env vars take precedence but don't cover class_count
- Add stack_threads/class_count/headroom descriptions

Copilot AI left a comment

Copy link
Copy Markdown

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 rewrites docs/IMPLEMENTING_JRES.md to document the newer BaseJRE template-method pattern (introduced in #1288) and remove the older long-form “manual boilerplate” JRE provider implementation guidance.

Changes:

  • Replaces large per-provider implementation walkthroughs with a BaseJRE variation-points model and a short 3-step “how to add a JRE” guide.
  • Adds concise examples for standard prefix matching, exact-dir matching, and install-error hints.
  • Updates operational reference sections (memory calculator, JVMKill, troubleshooting) and refreshes examples to Java 21.

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

Comment thread docs/IMPLEMENTING_JRES.md Outdated
Comment thread docs/IMPLEMENTING_JRES.md Outdated
Comment thread docs/IMPLEMENTING_JRES.md Outdated
Comment thread docs/IMPLEMENTING_JRES.md
Comment thread docs/IMPLEMENTING_JRES.md
…NTING_JRES.md

Addresses PR review:
- Add missing MemoryCalculatorCommand() to the jres.JRE interface excerpt.
- Add the missing `type MinimalJRE` so the no-extra-opts example compiles.
- Correct detection/version docs to match DetectJREByEnv/GetJREVersion: the
  documented JBP_CONFIG_<NAME>_JRE name (recommended) or the auto-generated
  JBP_CONFIG_<KEY> alias. JBP_CONFIG_COMPONENTS is deprecated and unused for
  selection; there is no BP_JAVA_<JREKEY> variable.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread docs/IMPLEMENTING_JRES.md Outdated
Comment thread docs/IMPLEMENTING_JRES.md Outdated
…v var

Copilot review:
- stack_threads default is 250 (DefaultStackThreads in src/java/jres/jre.go), not 200
- troubleshooting resolution order used JBP_CONFIG_<KEY>_JRE; the code checks the
  documented JBP_CONFIG_<NAME>_JRE name or the auto-generated JBP_CONFIG_<KEY> alias
@ramonskie ramonskie requested a review from kiril-keranov July 9, 2026 14:50
@stokpop stokpop merged commit 50e40f9 into cloudfoundry:main Jul 9, 2026
1 check 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.

3 participants