Skip to content

APAM Toolkit and Setup Guide

Thibaud Flury edited this page Aug 22, 2014 · 16 revisions

Table of Contents

ApAM for Users

At the end of this section, you will have a full-fledged ApAM machine running on your computer, ready to use Service-Oriented-Applications.
You will also be be able to :

  • Start and Stop pre-configured ApAM machines
  • Use specific ApAM shell commands to install, start, stop, check your applications
  • Use basic debugging commands within the Felix environment

Requirements

Launching Apam

After download the Ready-to-use ApAM (or downloading and compiling the source), unzip the file. You can then launch the ApAM Machine in various ways :

  • Use the scripts at the apam-basic-distribution-VERSION directory : apam.bat for Windows or apam for UNIX/Linux
  • Open a terminal at the root directory : apam-basic-distribution-VERSION. and launch :
java -jar bin/felix.jar

This will handle you a terminal (just like your DOS/Linux terminal), this terminal is provided by felix (OSGI distribution by Apache) and allows us to check the installed bundles, type lb to check all bundles installed and the current state, apam should be in that list with the state started.
If that is the case, congratulation! you have apam up and running.

Useful Felix shell commands :
Command Description
lb List all installed bundles with their number, current state and Name
help Displays available commands
help command Displays information about the specific command
install urls_to-bundle Install bundle using URLs (might be local file://path_to_bundle.jar)
start bundle_number or urls_to-bundle Start currently installed bundle (with bundle number) or install AND start using URL
stop bundle_number Stop the bundle
uninstall bundle_number Uninstall the bundle
For more information about Felix shell commands, please refer to The Felix Framework Documentation.
The good news is that ApAM is designed to simplify development of OSGi bundles. So you won't need Felix shell commands most of the time. Using the help command, you may notice a few command prefixed with apam:. These are the ApAM shell commands (please notice that it is not mandatory to use the prefix, apam:inst is the same as inst).

ApAM shell commands

You can always use help command_name to get more information about a command or its syntax.

Command Description
l component_name Try to creates and start (l stands for load) a new instance of the target ApAM Component (resolving dependencies and relation).
inst List all instances ApAM Components running on the platform
inst instance-name Display information about a particular instances
implem List all implementations ApAM Components currently available on the platform
implem implementation-name Display information about a particular implementation
spec List all specifications ApAM Components currently available on the platform
spec specification-name Display information about a particular specification
compo List all composite instances ApAM Components currently running on the platform
compo specification-name Display information about a particular composite instance currently running
compoType List all composite implementations ApAM Components currently 'available' on the platform
compoType implementation-name Display information about a particular composite implementation
changeproperty component-name property-name property-value Set or update a property of a particular instance
pending Display all pending installations (not resolved yet, missing dependencies)
app List all ApAM applications (an application being some kind of composite component) running on the platform
app application-name Display information about a particular application
displayWires instance-name List all ApAM Wires (dependencies and relations) between the specified instance and other instances
cr composite-name List all OSGi Bundles Repositories (OBR) defined for a particular Composite (if specific repositories are defined).
ur composite-name Update the ApAM Components list : Specification, Implementation, Instances, Composites described in the OSGi Bundles Repositories (OBR) defined for a particular Composite

ApAM for Service Developers

At the end of this section, you will have an environment ready to develop new Service-Oriented-Applications for your ApAM machine.
You will also have :

  • An empty skeleton of a maven project packaging ApAM Component
  • An empty skeleton of the specific ApAM descriptor
You will be ready to try the ApAM Tutorials.

Requirements

  • Same requirements as ApAM users
  • Java Development Kit (1.6 or later) Oracle Latest JDK
  • Maven (3.0 or later) Apache Maven
  • MongoDB (2.2 or later) 1 {optional}
  • If you intend to follow the Tutorials, these have been designed using Eclipse with m2e plugin but the choice of an IDE is up to you as long as it supports maven.
[1] for persisting apam components creation, destruction and modifications

Maven Project Descriptor

Maven can be used to greatly improve the creation of ApAM components (apam-maven-plugin is a specific plugin designed to package ApAM Components).
Maven Project Descriptor (pom.xml) include all minimal dependencies and plugins to build an OSGi bundle corresponding to an ApAM Component. The source code of an ApAM component is basically a set of Plain Old Java Objects (POJO). No specific ApAM package is needed to build a component1.
To build your project, simply use the following command inside a command terminal at the root directory of your project : mvn clean install.
[1] You can also take use of the ApAM API (already available but documentation in progress, to be released soon).

ApAM Component Descriptor

Each ApAM component must be described using the APAM DSL language. This XML description is used by ApAM to build the component upon the source code. The corresponding file must be available in src/main/resource/metadata.xml for your project.

Here is a basic ApAM Component Descriptor.


ApAM for Core Source Developers

Requirements

  • Same requirements as ApAM users and developers
  • GIT Client GIT Client

Source code

In case of you are interested in checking out the source a take a deeper look in Apam architecture. Source code can be downloaded by:

  • git clone
git clone https://github.com/AdeleResearchGroup/ApAM/

Clone this wiki locally