Skip to content
This repository

Examples 

BryanHunt edited this page · 4 revisions
Clone this wiki locally

You will need to create a target platform with the following:

If you would like to minimize your dependencies, you only need the following bundles from Restlet JEE:

  • org.restlet.jar
  • org.restlet.ext.servlet.jar

Download the example projects:

The examples are packaged as Eclipse projects that you can import into your workspace directly from the zip file. You should be able to use any OSGi 4.2 or later implementation, but you must have an embedded web container like Jetty. Start up OSGi and make sure the web container (Jetty), declarative services, org.eclipselabs.restlet.servlet bundle are active. The examples contain launchers you can use with the Eclipse IDE.

To test the example application, point your web browser to:

  • http://localhost:8080/hello
  • http://localhost:8080/example
  • http://localhost:8080/extension

The server uses the standard OSGi HTTP service. To change the port it is running on use the -Dorg.osgi.service.http.port parameter in the launch config

To see the dynamic nature of the system, go to the OSGi console in eclipse and stop/start the following bundles:

  • org.eclipselabs.restlet.examples.resource
  • org.eclipselabs.restlet.examples.resource.extension

Reload the URI's above as you stop / start the bundles to see that the resources are dynamic.

osgi> ss eclipselabs

Framework is launched.

id  State       Bundle
3   ACTIVE      org.eclipselabs.restlet.examples.app_1.0.0.qualifier 
6   ACTIVE      org.eclipselabs.restlet.examples.resource.extension_1.0.0.qualifier
9   ACTIVE      org.eclipselabs.restlet.examples.resource_1.0.0.qualifier
10  ACTIVE      org.eclipselabs.restlet.servlet_1.0.0.qualifier
16  ACTIVE      org.eclipselabs.restlet_1.0.0.qualifier
27  ACTIVE      org.eclipselabs.restlet.registry_1.0.0.qualifier

osgi> stop 9
osgi> stop 6
osgi> start 9
osgi> start 6
Something went wrong with that request. Please try again.