|  |  | 
|  | <!DOCTYPE html> | 
|  | <html lang="en"> | 
|  | <head> | 
|  | <meta charset="utf-8"> | 
|  | <meta name="viewport" content="width=device-width, initial-scale=1"> | 
|  | <meta name="description" content=""> | 
|  | <meta name="author" content=""> | 
|  |  | 
|  | <title>Configuration Admin / Apache Celix</title> | 
|  |  | 
|  |  | 
|  | <link rel="icon" href="/assets/img/favicon.ico"> | 
|  |  | 
|  |  | 
|  | <link href="/assets/css/bootstrap.min.css" rel="stylesheet"> | 
|  |  | 
|  |  | 
|  | <link href="/assets/css/style.css" rel="stylesheet"> | 
|  |  | 
|  |  | 
|  | <script> | 
|  | var _paq = window._paq = window._paq || []; | 
|  |  | 
|  | _paq.push(['disableCookies']); | 
|  |  | 
|  | _paq.push(['trackPageView']); | 
|  | _paq.push(['enableLinkTracking']); | 
|  | (function() { | 
|  | var u="https://analytics.apache.org/"; | 
|  | _paq.push(['setTrackerUrl', u+'matomo.php']); | 
|  | _paq.push(['setSiteId', '9']); | 
|  | var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; | 
|  | g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); | 
|  | })(); | 
|  | </script> | 
|  |  | 
|  |  | 
|  | </head> | 
|  | <body class="light-grey"> | 
|  |  | 
|  | <a href="https://github.com/apache/celix" class="github-ribbon"> | 
|  | <img src="/assets/img/forkme_right_red_aa0000.png" alt="Fork me on GitHub"> | 
|  | </a> | 
|  |  | 
|  |  | 
|  | <nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> | 
|  | <div class="container"> | 
|  | <a class="navbar-brand" href="/"> | 
|  | <img src="/assets/img/celix-white.svg" height="40" class="d-inline-block align-top" alt="Celix Logo"> | 
|  | </a> | 
|  | <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"> | 
|  | <span class="navbar-toggler-icon"></span> | 
|  | </button> | 
|  | <div class="collapse navbar-collapse" id="navbarResponsive"> | 
|  | <ul class="navbar-nav ml-auto"> | 
|  | <li class="nav-item"> | 
|  | <a class="nav-link" href="/">Home</a> | 
|  | </li> | 
|  | <li class="nav-item"> | 
|  | <a class="nav-link" href="/download.cgi">Download</a> | 
|  | </li> | 
|  | <li class="nav-item dropdown active"> | 
|  | <a class="nav-link dropdown-toggle" href="#" id="ddDocs" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | 
|  | Docs | 
|  | </a> | 
|  | <div class="dropdown-menu" aria-labelledby="ddDocs"> | 
|  | <a class="dropdown-item" href="/docs/2.4.0/docs.html">2.4.0 (latest)</a> | 
|  | <a class="dropdown-item" href="/docs/2.3.0/docs.html">2.3.0</a> | 
|  | <a class="dropdown-item" href="/docs/2.2.1/docs.html">2.2.1</a> | 
|  | <a class="dropdown-item" href="/docs/2.1.0/docs.html">2.1.0</a> | 
|  | </div> | 
|  | </li> | 
|  | <li class="nav-item dropdown"> | 
|  | <a class="nav-link dropdown-toggle" href="#" id="ddContributing" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | 
|  | Contributing | 
|  | </a> | 
|  | <div class="dropdown-menu" aria-labelledby="ddContributing"> | 
|  | <a class="dropdown-item" href="/contributing/youatcelix.html">You at Celix</a> | 
|  | <a class="dropdown-item" href="/contributing/submitting-patches.html">Submitting patches</a> | 
|  | <a class="dropdown-item" href="/contributing/source-and-builds.html">Source code and builds</a> | 
|  | <hr> | 
|  | <a class="dropdown-item" href="/contributing/releasing.html">Releasing</a> | 
|  | <a class="dropdown-item" href="/contributing/volunteers.html">Volunteers</a> | 
|  | <a class="dropdown-item" href="https://whimsy.apache.org/board/minutes/Celix.html">Board Reports</a> | 
|  | </div> | 
|  | </li> | 
|  | <li class="nav-item dropdown"> | 
|  | <a class="nav-link dropdown-toggle" href="#" id="ddSupport" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | 
|  | Support | 
|  | </a> | 
|  | <div class="dropdown-menu" aria-labelledby="ddSupport"> | 
|  | <a class="dropdown-item" href="/support/mailing-list.html">Mailing Lists</a> | 
|  | <a class="dropdown-item" href="/support/issue-tracking.html">Issue Tracking</a> | 
|  | </div> | 
|  | </li> | 
|  | <li class="nav-item dropdown"> | 
|  | <a class="nav-link dropdown-toggle" href="#" id="ddFoundation" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | 
|  | ASF | 
|  | </a> | 
|  | <div class="dropdown-menu" aria-labelledby="ddFoundation"> | 
|  | <a class="dropdown-item" href="https://www.apache.org/">ASF Home</a> | 
|  | <a class="dropdown-item" href="https://www.apache.org/foundation/how-it-works.html">How it works</a> | 
|  | <a class="dropdown-item" href="https://www.apache.org/licenses/">License</a> | 
|  | <a class="dropdown-item" href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a> | 
|  | <a class="dropdown-item" href="https://www.apache.org/foundation/thanks.html">Thanks</a> | 
|  | <a class="dropdown-item" href="https://www.apache.org/security/">Security</a> | 
|  | <a class="dropdown-item" href="https://www.apache.org/foundation/policies/conduct">Code of Conduct</a> | 
|  | </div> | 
|  | </li> | 
|  | </ul> | 
|  | </div> | 
|  | </div> | 
|  | </nav> | 
|  |  | 
|  |  | 
|  | <div class="section"> | 
|  | <div class="container"> | 
|  | <div class="row py-4"> | 
|  | <div class="col-sm-12 card"> | 
|  | <div class="card-body pt-5"> | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  | <a href="/docs/2.3.0/docs.html" title="back to documentation"><< back to documentation</a> | 
|  |  | 
|  |  | 
|  |  | 
|  | <!-- | 
|  | Licensed to the Apache Software Foundation (ASF) under one or more | 
|  | contributor license agreements.  See the NOTICE file distributed with | 
|  | this work for additional information regarding copyright ownership. | 
|  | The ASF licenses this file to You under the Apache License, Version 2.0 | 
|  | (the "License"); you may not use this file except in compliance with | 
|  | the License.  You may obtain a copy of the License at | 
|  |  | 
|  | http://www.apache.org/licenses/LICENSE-2.0 | 
|  |  | 
|  | Unless required by applicable law or agreed to in writing, software | 
|  | distributed under the License is distributed on an "AS IS" BASIS, | 
|  | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | See the License for the specific language governing permissions and | 
|  | limitations under the License. | 
|  | --> | 
|  | <h1 id="configuration-admin">Configuration Admin</h1> | 
|  | <hr> | 
|  | <h2 id="introduction">Introduction</h2> | 
|  | <p>The configuration Admin service allows defining and deploying configuration data to bundles. | 
|  | When compared to config.properties it adds the option to update configuration data by providing a persistent storage. It also allows changing configuration data at run-time.</p> | 
|  | <hr> | 
|  | <h2 id="design">Design</h2> | 
|  | <p>The config_admin bundle implements the configuration_admin service, the interface to configuration objects and the interface of a managed service. At the moment, the implementation uses a config_admin_factory to generate config_admin services for each bundle that wants to use this service. This is an inheritance of the original design and not needed. | 
|  | The configuration data is stored persistently in a subdirectory store of the current bundle directory. | 
|  | The filenames have the name of the PID and have an extension pid, e.g. base.device1.pid | 
|  | The files contains a list of key/value pairs. At least the following keys need to be present: | 
|  | service.bundleLocation | 
|  | service.pid</p> | 
|  | <hr> | 
|  | <h2 id="todo">TODO</h2> | 
|  | <ol> | 
|  | <li>Test the configuration of a service_factory</li> | 
|  | <li>Think about the option to allow remote update of the managed_services</li> | 
|  | <li>Support configuration of multiple managed services with the same PID. At the moment, only one service is bound to a configuration object. | 
|  | To support this the getConfiguration2 function needs to be called with a location NULL according to the spec.</li> | 
|  | </ol> | 
|  | <hr> | 
|  | <h2 id="usage">Usage</h2> | 
|  | <ol> | 
|  | <li>Bundle that needs configuration data | 
|  | This bundle has to register next to its normal service a managed service that has an update method. This managed service needs to be registered with a properties object that contains the key/value pair service.pid=<PID NAME>. | 
|  | Use config_admin_tst/example_test as an example (it is better than example_test2)</li> | 
|  | <li>Bundle/application that wants to update the configuration data of the system | 
|  | This bundle needs to retrieve the running config_admin service. With this service it can retrieve all configuration objects for all known Persistent Identifiers (PIDs). For each PID, get all properties that need to be updated. See config_admin_test for an example.</li> | 
|  | </ol> | 
|  |  | 
|  |  | 
|  | </div> | 
|  | </div> | 
|  | </div> | 
|  | </div> | 
|  | </div> | 
|  |  | 
|  |  | 
|  | <footer class="py-3 bg-secondary"> | 
|  | <div class="container"> | 
|  | <div class="row"> | 
|  | <div class="col-md-8 text-center"> | 
|  | <p class="m-0 text-white"> | 
|  | Copyright © 2025 The Apache Software Foundation, Licensed under | 
|  | the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>. | 
|  | <br> | 
|  | Apache Celix, Celix, Apache, the Apache feather logo and the Apache Celix logo are trademarks of The Apache Software Foundation. | 
|  | </p> | 
|  | </div> | 
|  | <div class="col-md-4 text-center"> | 
|  | <a href="https://www.apache.org/events/current-event.html" target="_blank"> | 
|  | <img src="https://www.apache.org/events/current-event-234x60.png" title="Apache Event" width="234" height="60" border="0"> | 
|  | </a> | 
|  | </div> | 
|  | </div> | 
|  | </div> | 
|  | </footer> | 
|  |  | 
|  |  | 
|  | <script src="/assets/js/jquery.min.js"></script> | 
|  | <script src="/assets/js/bootstrap.bundle.min.js"></script> | 
|  |  | 
|  |  | 
|  | </body> | 
|  | </html> |