Celix started during the summer of 2010 as a simple project to see if it is possible to dynamically load libraries (at runtime) in C. After some initial testing and searching this is supported out of the box using Dynamic Loading.

Since Dynamic Loading only solves how libraries can be loaded and used, a framework has to be made to integrate it in. For Java such frameworks exists, with OSGi being one of the leading specifications. OSGi provides guidelines for services, dynamic behavior, bundling, deployment etc. But the OSGi specification is targeted specifically to Java, and can not be used for C.

Celix focuses on adapting and implementing the OSGi specification in C. While the concepts of OSGi can be mapped, , relatively easy, on C, it is not possible to plainly implement the specification. Several key aspects rely on Java, and for C alternatives had to be found:

  • Service Interfaces

    OSGi uses Java Interfaces to describe and expose a service, without exposing the actual implementation. While in C it is possible to describe a service in a header file, it is not possible to expose this service. To be able to expose services in C a struct with function pointers is used. An activator is responsible for filling these pointer, after which the struct is registered as a service.

  • Deployment

    OSGi uses bundles (which are actually jar files) to deploy one or more services. Bundles contain the libraries, resources and additionally a manifest file describing the content of the bundle. In C libraries contain only the Objects compiled out of the source. It is not possible to add resources (and the manifest). To be able to have useful bundles, a zip file is used in which the library and resources are packed.

  • Exported Packages

    OSGi uses packages to export services and types. Since C doesn't have packages/namespaces it is not possible to export a group of services via a package. Instead, the actual service is exported, and additional types can be used using the definition of the type.

After identifying and solving these problems, it was possible to create a framework following most of the OSGi specification. Since there are several Open Source OSGi implementation, it made sense to look at these as either a guide or a source for porting generic behavior. As such, Celix is heavily based on Apache Felix, and several parts are even a direct port of existing Felix code.

With a working prototype, discussion started about how to continue developing Celix. As a generic framework, providing middleware for any kind of dynamic system, it made sense to Open Source Celix and try to grow a community to support and implement Celix. Since Celix is based on Felix, it was a logical choice to choose Apache as home for it.

In September of 2010 the Celix Proposal was written and published to the Apache Incubator. After some discussion a vote was called for, and Celix was accepted as new Incubator Project. Since then work has begun to grow a community, increase awereness and implement Celix.