blob: 521c1474b8dab4cb903fff7d5a4fd9969b5ca113 [file] [log] [blame]
<!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>Introduction / 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">
<style>
.card-body img {
max-width: 100%;
width: 100%;
height: auto;
}
.card-body img + em {
text-decoration: underline;
}
</style>
<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 class="edit-on-gh" href="https://github.com/apache/celix/edit/master/documents/README.md" title="Edit this page on GitHub">Edit on GitHub</a>
<a href="/docs/2.4.0/docs.html" title="back to documentation">&lt;&lt; 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="apache-celix-introduction">Apache Celix Introduction</h1>
<h2 id="what-is-apache-celix">What is Apache Celix</h2>
<p>Apache Celix is an implementation of a dynamic service framework inspired by the
<a href="https://www.osgi.org/developer/specifications">OSGi specification</a> and adapted to C and C++ (C++17).
It is a framework to develop dynamic modular software applications using component and in-process service-oriented programming.</p>
<p>Apache Celix core is written in C and has a C++17 header-only API on top of the C API.</p>
<p>Building applications with Apache Celix can be done by creating <code>bundles</code> which provide and use <code>services</code>;
These <code>services</code> can be used directly or in a declarative way using <code>components</code>.
To run a selection of bundles, an Apache Celix <code>container</code> executable can be created. An Apache Celix <code>containter</code> will<br>
start an Apache Celix framework and install and start the provided bundles.</p>
<h2 id="c-patterns">C Patterns</h2>
<p>Apache Celix is written in C and uses some C patterns to improve the development experience.</p>
<h2 id="bundles">Bundles</h2>
<p>An Apache Celix Bundle is a zip file which contains a collection of shared libraries,
configuration files and optional an activation entry.
Bundles can be dynamically installed and started in an Apache Celix framework.</p>
<h2 id="services">Services</h2>
<p>An Apache Celix Service is a pointer registered to the Apache Celix framework under a set of properties (metadata).
Services can be dynamically registered into and looked up from the Apache Celix framework.</p>
<p>By convention a C service in Apache Celix is a pointer to struct of function pointers and a C++ service is a pointer
(which can be provided as a <code>std::shared_ptr</code>) to an object implementing a (pure) abstract class.</p>
<h2 id="components">Components</h2>
<p>Apache Celix also offers a way to create components which interact with dynamic services in declarative way.</p>
<p>This removes some complexity of dynamic services by declaring service dependency and configuring the dependency
as required or optional.</p>
<p>Apache Celix components can be created using the built-in C and C++ dependency manager.</p>
<p>Note that the dependency manager is not part of the OSGi standard, and it is inspired by the
Apache Felix Dependency Manager.</p>
<h2 id="containers">Containers</h2>
<p>Apache Celix Containers are executables which starts an Apache Celix framework, with a set of preconfigured properties
and a set of preconfigured bundles.
Although it is also possible to create and start a Celix framework in code, the benefit of a Celix container
is that this can be done with a single <code>add_celix_container</code> Apache Celix CMake command.</p>
<h2 id="c-support">C++ Support</h2>
<p>One of the reasons why C was chosen as implementation language is that C can act as a common denominator for
(service oriented) interoperability between a range of languages.</p>
<p>C++ (C++17) support is build on top of the C API and is realized using a header only implementation.
This means that all the binary artifact for the Apache Celix framework and util library are pure C and do not depend on
libstdc++.</p>
<p>Apache Celix also offers some C++ only libraries and bundles. The C++ libraries are also header only, but the C++
bundles contains binaries depending on the stdlibc++ library.</p>
<h2 id="more-information">More information</h2>
<ul>
<li>Building
<ul>
<li><a href="building/README.html">Building and Installing Apache Celix</a></li>
<li><a href="building/dev_celix_with_clion.html">Building and Developing Apache Celix with CLion</a></li>
</ul>
</li>
<li>C Patterns
<ul>
<li><a href="c_patterns.html">Apache Celix C Patterns</a></li>
</ul>
</li>
<li>Framework
<ul>
<li><a href="bundles.html">Apache Celix Bundles</a></li>
<li><a href="services.html">Apache Celix Services</a></li>
<li><a href="components.html">Apache Celix Components</a></li>
<li><a href="framework.html">Apache Celix Framework</a></li>
<li><a href="containers.html">Apache Celix Containers</a></li>
<li><a href="patterns.html">Apache Celix Patterns</a></li>
<li><a href="scheduled_events.html">Apache Celix Scheduled Events</a></li>
</ul>
</li>
<li><a href="cmake_commands">Apache Celix CMake Commands</a></li>
<li><a href="subprojects.html">Apache Celix Sub Projects</a></li>
<li><a href="development/README.html">Apache Celix Coding Conventions Guide</a></li>
</ul>
</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 &copy; 2024 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>