karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Freeman Fang (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (KARAF-6380) Karaf does not pass configs with dashes to ManagedService
Date Wed, 14 Aug 2019 16:28:00 GMT

     [ https://issues.apache.org/jira/browse/KARAF-6380?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Freeman Fang resolved KARAF-6380.
---------------------------------
    Resolution: Information Provided

> Karaf does not pass configs with dashes to ManagedService
> ---------------------------------------------------------
>
>                 Key: KARAF-6380
>                 URL: https://issues.apache.org/jira/browse/KARAF-6380
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 4.2.6
>            Reporter: Kamil
>            Assignee: Freeman Fang
>            Priority: Major
>
> I have a bundle with this code in activator:
>  
> {code:java}
>   @Override
>   public final void start(final BundleContext bundleContext) throws InterruptedException
{
> // final String pid = "foo.bar.e35a73c8-f720-4652-83bb-2b9ed79ea51e"; //does not work!
>     final String pid = "foo.bar.e35a73c8f720465283bb2b9ed79ea51e";
>     ServiceRegistration<ManagedService> serviceReg = bundleContext.registerService(ManagedService.class,
new ConfigUpdater(), new Hashtable<>(singletonMap(Constants.SERVICE_PID, pid)));
> }
> {code}
> where:
> {code:java}
>   private final class ConfigUpdater implements ManagedService {
>       @Override
>       public void updated(final Dictionary<String, ?> config) throws ConfigurationException
{
>         if (config == null) {
>           System.out.println("The config is null!");
>           return;
>         }
>       }
>   }
> {code}
> and two files in $KARAF_HOME/etc:
>  * foo.bar.e35a73c8-f720-4652-83bb-2b9ed79ea51e.cfg
>  * foo.bar.e35a73c8f720465283bb2b9ed79ea51e.cfg
> the first pid gives null as a config, while the second works



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Mime
View raw message