Triaxrs reference documentation

This document shall give a complete and concise documentation of Triaxrs. To get started with Triaxrs we suggest you have a look at the tutorials.

Goals and functionality

The goal of Triaxrs is to implement JAX-RS (aka JSR 311) in a way that runs smoothly in an OSGi container and to leverage the possibilities of OSGi declarative service to locate JAX-RS components.

System requirements

Triaxrs requires the following to run [1]:

Location of resources and providers

Triaxrs locates the providers and root resources by locating 0 or 1 service implementing javax.ws.rs.core.Application and an arbitrary number of individual root resources and providers. Individual root resources and providers are POJOs meeting the requirements of the JAX-RS specification and being exposed as service implementing java.lang.Object annotated with a property of type Boolean named javax.ws.rs set to true.

Configuration

It is possible to define a default path prefix that is prepended to all resources of a bundle. The default prefix can be defined in the bundle manifest using the "Triaxrs-PathPrefix"-header. The user has also the opportunity to change or define a custom path prefix of such resource bundle through the Triaxrs Prefix Manager service. The Triaxrs Prefix Manager has a property "mappings" which contains the the mappings between a symbolic name of a bundle and the custom prefix. It has also the properties "Triaxrs-UseDefaultPrefix" and "Triaxrs-UseCustomPrefix" which defines, if default/custom prefix should be used.

The WRHAPI service org.wymiwyg.wrhapi.activator.Activator has a property "port" indicating the port under which the resources are reachable, the default is 8080.

Compiling from sources

The Triaxrs sources [7] are compiled using Maven [8]. You should add the following repositories to your maven settings.xml:

Maven will dowload the pom of the parent project from the specified repository and use the repositories section therein to locate the repositories for other dependencies.

Notes

[1] it is possible to run Triaxrs with limited functionality without the OSGi environment, but this is not currently documented

[2] http://java.sun.com/javase/downloads/index.jsp

[3] http://felix.apache.org/

[4] http://www.eclipse.org/equinox/

[5] Clerezza is providing the API as bundle at http://repo.trialox.org/distro/org/apache/clerezza/ext/javax.ws.rs/ (as soon as a release is available), note that the versioning of this bundle is independent of the JAX-RS versioning, for instance version 0.3 bundles version 1.0 of the API

[6] see http://wrhapi.wymiwyg.org, downloadable at http://wymiwyg.berlios.de/maven2/org/wymiwyg/

[7] see http://trialox.org/projects/org.apache.clerezza.triaxrs.parent/org.apache.clerezza.triaxrs/source-repository.html for instructions on how to access the sources

[8] http://maven.apache.org/

Copyright (c) 2008 trialox.org (trialox AG, Switzerland)