Skip to content

Commit

Permalink
Fixed incorrect markdown format
Browse files Browse the repository at this point in the history
  • Loading branch information
rlenferink committed Mar 31, 2017
1 parent a030567 commit 0616690
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 77 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#Apache Celix [![Build Status](https://travis-ci.org/apache/celix.svg?branch=develop)](https://travis-ci.org/apache/celix) [![Coverage Status](https://coveralls.io/repos/apache/celix/badge.svg?branch=develop&service=github)](https://coveralls.io/github/apache/celix?branch=develop) [![Coverity Scan Build Status](https://scan.coverity.com/projects/6685/badge.svg)](https://scan.coverity.com/projects/6685)
# Apache Celix [![Build Status](https://travis-ci.org/apache/celix.svg?branch=develop)](https://travis-ci.org/apache/celix) [![Coverage Status](https://coveralls.io/repos/apache/celix/badge.svg?branch=develop&service=github)](https://coveralls.io/github/apache/celix?branch=develop) [![Coverity Scan Build Status](https://scan.coverity.com/projects/6685/badge.svg)](https://scan.coverity.com/projects/6685)
Apache Celix is an implementation of the OSGi specification adapted to C and C++ (C++11). It is a provides a framework to develop (dynamic) modular software applications using component and/or service-oriented programming.

##Building
## Building
For information how to build Apache Celix see [Building Apache Celix](documents/building/readme.md)

##Introduction to Apache Celix
## Introduction to Apache Celix
For an introduction into Apache Celix see [Apache Celix Intro](documents/intro/readme.md)

##Getting Started with Apache Celix
## Getting Started with Apache Celix
For a guide how to start writing your own bundles and services see [Getting Started Guide](documents/getting_started/readme.md)

18 changes: 9 additions & 9 deletions documents/building/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Apache Celix - Building and Installing
# Apache Celix - Building and Installing
Apache Celix aims to be support a broad range of UNIX platforms.

Currently the [continuous integration build server](https://travis-ci.org/apache/celix) builds and tests Apache Celix for:
Expand All @@ -12,7 +12,7 @@ Currently the [continuous integration build server](https://travis-ci.org/apache
* Android (cross-compiled on Ubuntu Trusty Tahr)
* GCC

#Preparing
# Preparing
The following packages (libraries + headers) should be installed on your system:

* Development Environment
Expand Down Expand Up @@ -65,7 +65,7 @@ For OSX systems with brew installed, the following command should work:
brew link --force libffi
```

##Download the Apache Celix sources
## Download the Apache Celix sources
To get started you first have to download the Apache Celix sources. This can be done by cloning the Apache Celix git repository:

```bash
Expand All @@ -78,11 +78,11 @@ cd ${WS}
git clone --single-branch --branch master https://github.com/apache/celix.git
```

##Building Apache Celix
## Building Apache Celix
Apache Celix uses [CMake](https://cmake.org) as build system. CMake can generate (among others) makefiles or ninja build files.
using ninja build files will result in a faster build.

###Building using CMake and makefiles:
### Building using CMake and makefiles:
```bash
cd ${WS}/celix
mkdir build
Expand All @@ -91,7 +91,7 @@ cmake ..
make
```

###Building using CMake and Ninja
### Building using CMake and Ninja
```bash
cd ${WS}/celix
mkdir build
Expand All @@ -100,7 +100,7 @@ cmake -G Ninja ..
ninja
```

##Editing Build options
## Editing Build options
With use of CMake, Apache Celix makes it possible to edit build options. This enabled users, among other options, to configure a install location and select additional bundles.
To edit the options use ccmake or cmake-gui. For cmake-gui an additional package install can be necessary (Fedora: `dnf install cmake-gui`).

Expand All @@ -113,15 +113,15 @@ ccmake .

For this guide we assume the CMAKE_INSTALL_PREFIX is `/usr/local`.

##Installing Apache Celix
## Installing Apache Celix

```bash
cd ${WS}/celix/build
make
sudo make install
```

##Running Apache Celix
## Running Apache Celix

If Apache Celix is succesfully installed running
```bash
Expand Down
32 changes: 16 additions & 16 deletions documents/cmake_commands/readme.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#Apache Celix - CMake Commands
# Apache Celix - CMake Commands

For Apache Celix several cmake command are added to be able to work with Apache Celix bundles and deployments.

#Bundles
# Bundles

##add_bundle
## add_bundle
Add a bundle to the project. There are three variants:
- With SOURCES the bundle will be created using a list of sources files as input for the bundle activator library.
- With ACTIVATOR the bundle will be created using the library target or absolute path to existing library as activator library.
Expand Down Expand Up @@ -61,7 +61,7 @@ For SOVERSION only the major part is used. Expected scheme is "<major>.<minor>.<
- If IMPORT_LIBRARIES is provided all provided lib are added to the "Import-Library" manifest statement and added in the root of the bundle. libraries can be cmake library targets or absolute paths to existing libraries. This is not yet supported by the celix framework
- If HEADERS is provided the headers values are appended to the bundle manifest.

##bundle_private_libs
## bundle_private_libs
Add libraries to a bundle target. The libraries should be cmake library targets or an absolute path to a existing library.

```CMake
Expand All @@ -70,7 +70,7 @@ bundle_private_libs(<bundle_target>
)
```

##bundle_files
## bundle_files
Add files to the target bundle. DESTINATION is relative to the bundle archive root.
The rest of the command is conform file(COPY ...) cmake command.
See cmake file(COPY ...) command for more info.
Expand All @@ -88,7 +88,7 @@ bundle_files(<bundle_target>
```


##bundle_headers
## bundle_headers
Append the provided headers to the target bundle manifest.

```CMake
Expand All @@ -99,35 +99,35 @@ bundle_headers(<bundle_target>
)
```

##bundle_symbolic_name
## bundle_symbolic_name
Set bundle symbolic name

```CMake
bundle_symbolic_name(<bundle_target> symbolic_name)
```

##bundle_name
## bundle_name
Set bundle name

```CMake
bundle_name(<bundle_target> name)
```

##bundle_version
## bundle_version
Set bundle version

```CMake
bundle_version(<bundle_target> version)
```

##bundle_description
## bundle_description
Set bundle description

```CMake
bundle_description(<bundle_target> description)
```

##install_bundle
## install_bundle
Install bundle when 'make install' is executed.
Bundles are installed at `<install-prefix>/share/<project_name>/bundles`.
Headers are installed at `<install-prefix>/include/<project_name>/<bundle_name>`
Expand All @@ -147,9 +147,9 @@ install_bundle(<bundle_target>
- If HEADERS is provided the list of provided headers will be installed.
- If RESOURCES is provided the list of provided resources will be installed.

#Deployments
# Deployments

#add_deploy
# add_deploy
Add a deployment, consisting out of a selection of bundles, for the project.
Deployments can be used to run/test a selection of bundles in the celix framework.
A deployment can be found in `<cmake_build_dir>/deploy[/<group_name>]/<deploy_name>`.
Expand Down Expand Up @@ -182,7 +182,7 @@ If the bundle target is never added CMake will give an error:
- If BUNDLES is provided the list of bundles will be added the the generated config.properties for startup. Combined with COPY the bundles will also be copied to a bundles dir.
- If PROPERTIES is provided the list of properties will be appended to the generated config.properties

#deploy_bundles_dir
# deploy_bundles_dir
Deploy a selection of bundles to the provided bundle dir. This can be used to create an endpoints / proxies bundles dir for the remote service admin or drivers bundles dir for the device access.

```CMake
Expand All @@ -195,7 +195,7 @@ deploy_bundles_dir(<deploy_target_name>
)
```

#deploy_bundles
# deploy_bundles
Deploy the selected bundles. The bundles are configured for auto starting.

```CMake
Expand All @@ -206,7 +206,7 @@ deploy_bundles(<deploy_target_name>
)
```

#deploy_properties
# deploy_properties

```CMake
Add the provided properties to the target deploy config.properties.
Expand Down
20 changes: 10 additions & 10 deletions documents/getting_started/creating_a_simple_bundle.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#Apache Celix - Getting Started Guide: Creating a Simple Bundle
# Apache Celix - Getting Started Guide: Creating a Simple Bundle

##Intro
## Intro
This page is intended for first time users of Apache Celix. It should guide you through building & installing Apache Celix, setting up a new project, creating your first bundle, setting up the project for use with Eclipse project and finally running and debugging your bundle directly from eclipse workspace.

If there are any uncertainties or question, don't hesitate to ask your questions in the [Apache Celix mailing](https://celix.apache.org/support/mailinglist.html).

##Prerequisite
## Prerequisite
Some experience with a command line interface (xterm) is expected to be able to follow this guide.

##Building and Installing
## Building and Installing
For Apache Celix see [Building And Installing](../building/readme.md)

##Installing Eclipse CDT
## Installing Eclipse CDT
Download the latest eclipse CDT at [http://www.eclipse.org](http://www.eclipse.org) and install it on your system. For more information on how the install eclipse on your system consult the eclipse documentation. For this getting started guide the luna version of eclipse was used ([linux](http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/luna/R/eclipse-cpp-luna-R-linux-gtk-x86_64.tar.gz) [mac](http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/luna/R/eclipse-cpp-luna-R-macosx-cocoa-x86_64.tar.gz)).

##Apache Celix Bundle project
## Apache Celix Bundle project
Now that Apache Celix and Eclipse is installed, we are ready to create a new Apache Celix Bundle project.
CMake is used as build tool for Apache Celix projects.

Expand Down Expand Up @@ -209,7 +209,7 @@ void HelloWorldActivator::deinit() {
}
```

###Building
### Building
One of the highly recommended features of CMake is the ability to do out of source builds, the benefit is that all of the build results will go in a separate directory without cluttering the (source) project.
CMake also needs to able to find the cmake files Celix provides. This can be achieved by providing a CMAKE_MODULE_PATH variable (or setting the CMAKE_MODULE_PATH in the top level CMakeLists.txt).
For this example it is assumed that Celix in installed in `/usr/local`.
Expand All @@ -230,7 +230,7 @@ make all
Hopefully you will some some build results scrolling over the screen and actual build results in the build directory. There should be a hello_world.zip in the bundles/hello_world directory, this the actual bundle.
A bundle on its own has no real value, so lets setup a deployment and run the Apache Celix framwork with these bundles.

###Running
### Running

To create a deployment for the hello world bundles two things are needed:

Expand Down Expand Up @@ -275,7 +275,7 @@ help inspect
stop 0
```

##Apache Celix Bundle Project in Eclipse
## Apache Celix Bundle Project in Eclipse

A nice feature of CMake is the ability to generate Eclipse project files, with this feature bundles can also be developed with use of Eclipse. This should help speed up the development process.
To get started change directory to the build directory and generate a eclipse project file.
Expand All @@ -295,7 +295,7 @@ To build the project, use Project->Build All. To run or debug from Eclipse navig

![run project](getting_started_img3.png)

##Next
## Next

The idea behind service oriented programming is that functionality is provided and used by abstract service, which hide implementation details.
For a guide how to provide and use services see
Expand Down
4 changes: 2 additions & 2 deletions documents/getting_started/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Apache Celix - Getting Started Guide
# Apache Celix - Getting Started Guide

##Guides
## Guides
There are several guide to help you get started. The first guide is [Getting Started: Creating a simple bundle](creating_a_simple_bundle.md)
and this should get you started for your first C and/or C++ bundle.

Expand Down
2 changes: 1 addition & 1 deletion documents/getting_started/using_services_with_c.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Apache Celix - Using Services with C
# Apache Celix - Using Services with C

## Intro

Expand Down
2 changes: 1 addition & 1 deletion documents/getting_started/using_services_with_cxx.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Apache Celix - Using Services with C++
# Apache Celix - Using Services with C++

## Intro

Expand Down
26 changes: 13 additions & 13 deletions documents/intro/readme.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#Apache Celix Introduction
# Apache Celix Introduction

##What is Apache Celix
## What is Apache Celix
Apache Celix is an implementation of the [OSGi specification](https://www.osgi.org/developer/specifications) adapted to C and C++. It is a provides a framework to develop (dynamic) modular software applications using component and/or service-oriented programming.

Apache Celix is primarily developed in C and adds an additional abstraction, in the form of a library, to support for C++.

##Bundles
## Bundles
OSGi uses bundles as medium to (run-time) add and remove modules (additional functionality) to OSGi applications. For Java, OSGi bundles are jars with a OSGi specific manifest. For Apache Celix bundles are zip files containing an OSGi manifest (with some differences) and possible modules in the form of shared libraries. One of these modules can be the bundle activator in which case the Apache Celix framework will lookup the bundle create, start, stop and destroy symbols to manage the lifecycle of the bundle; This can be used bootstrap the bundles functionality.

##C and Objects
## C and Objects
C is a procedural programming language and as result has no direct support for the notion of a object.
To be able to follow the OSGi specification, a standard mapping from C to Java is used. This mapping takes care of how instances, parameters, return values and exceptions (error codes) work in Apache Celix.

###Example
### Example
Before going into detail, here is an example of the mapping from a method in Java to a function in C:

```Java
Expand All @@ -29,7 +29,7 @@ public interface BundleContext {
celix_status_t bundleContext_getServiceReferences(bundle_context_pt context, const char* serviceName, const char* filter, array_list_pt* service_references);
```
###Object methods
### Object methods
Using the provided example, the following templates can be extracted for mapping a object method to a C function:
```C
Expand Down Expand Up @@ -67,7 +67,7 @@ Note that although the first template is preferred, Apache Celix still uses the
Unless stated otherwise, the caller is owner of the output and should destroy/deallocate the result.
An exception is a const output parameters, this indicates the callee is still owner.

###Creating and destroying Objects
### Creating and destroying Objects
Objects in Apache Celix can generally be created and destroyed using a create and destroy functions.
For example:

Expand All @@ -90,25 +90,25 @@ void hashMapIterator_init(hash_map_pt map, hash_map_iterator_pt iterator);
void hashMapIterator_deinit(hash_map_iterator_pt iterator);
```

###OSGi documentation and Apache Celix
### OSGi documentation and Apache Celix
Apache Celix follows the OSGi API as close as possible, but since the OSGi specification is written primarily for Java, there will be differences (Java is OO, C is procedural).
Taking into account those differences and mapping explained before the OSGi javadoc can be used for a more in depth description of what the Apache Celix API offers.

* [OSGi core specification 4.3](https://osgi.org/javadoc/r4v43/core/index.html)
* [OSGi compendium specification 4.3](https://osgi.org/javadoc/r4v43/cmpn/index.html)

##What is a OSGi service?
## What is a OSGi service?
A OSGi service is a Java object register to the OSGi framework under a certain set of properties.
OSGi services are generally registered as a well known interface (using the `objectClass` property).

Consumers can dynamically lookup the services providing a filter to specify what kind of services their are interested in.

##C services in Apache Celix
## C services in Apache Celix
As mentioned OSGi uses Java Interfaces to define a service. Since C does not have Interfaces as compilable unit, this is not possible for Celix. To be able to define a service which hides implementation details, Celix uses structs with function pointers.

See [Apache Celix - Getting Started Guide](https://github.com/apache/celix/blob/master/documents/getting_started/readme.md) for a more in depth look at services and service usage.

##Impact of dynamic services
## Impact of dynamic services
Services in Apache Celix are dynamic, meaning that they can come and go at any moment.
How to cope with this dynamic behaviour is very critical for creating a stable solution.

Expand All @@ -124,13 +124,13 @@ Apache Celix offers different solutions how to cope with this dynamic behaviour:

Even though the dependency manager is not part of the OSGi specification, this is the preferred way because it uses a higher abstraction and removes a lot boilerplate code.

##C++ Support
## C++ Support

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.
C++ support is added with the use of a [C++ Dependency Manager](../../dependency_manager_cxx/readme.md).
The Dependency Manager is arguably the most convenient way to interact with services, confers most uses cases and eliminates the necessity to port the rest of the (large) API to C++.

##Documentation
## Documentation

For more information see:

Expand Down
6 changes: 3 additions & 3 deletions documents/roadmap/improvement_ideas.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ could be used if preferable.
Now an admin is responsible for serialization and communication.

# Add pub sub admins.
The current implementation uses JSON over multicast UDP or over ZMQ.
One or more could be added. i.e. serialization based on Apache-Avro, communication over TCP / Kafka / Shared Memory
Add interfaces for other languages (Python / Rust / Go / ...)
The current implementation uses JSON over multicast UDP or over ZMQ.
One or more could be added. i.e. serialization based on Apache-Avro, communication over TCP / Kafka / Shared Memory
Add interfaces for other languages (Python / Rust / Go / ...)
Loading

0 comments on commit 0616690

Please sign in to comment.