Skip to content

Add @Config annotation for shell command configuration injection#2517

Open
jbonofre wants to merge 1 commit intoapache:mainfrom
jbonofre:feat/shell-config-annotation
Open

Add @Config annotation for shell command configuration injection#2517
jbonofre wants to merge 1 commit intoapache:mainfrom
jbonofre:feat/shell-config-annotation

Conversation

@jbonofre
Copy link
Copy Markdown
Member

@jbonofre jbonofre commented Apr 5, 2026

Shell commands currently have no convenient way to access OSGi configuration properties. This adds a @Config annotation that allows injecting ConfigurationAdmin properties directly into command fields:

@Config(pid = "foo.bar")
Map<String, Object> properties;

Allow shell commands to inject OSGi ConfigurationAdmin properties
via a new @config(pid = "...") annotation on Map<String, Object>
fields.

ManagerImpl resolves the configuration PID at instantiation time and
injects the properties as a LinkedHashMap. CommandExtension
automatically tracks ConfigurationAdmin availability when a command
uses @config.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

Test Results

234 files  +1  234 suites  +1   21m 59s ⏱️ +7s
923 tests +6  875 ✅ +6  48 💤 ±0  0 ❌ ±0 
927 runs  +6  879 ✅ +6  48 💤 ±0  0 ❌ ±0 

Results for commit 1a1edc2. ± Comparison against base commit 031d9a1.

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.

Update Karaf shell command to support injection of a configuration pid

1 participant