wiki:RpDynamicCreation

Dynamic Resource Creation

The Resource Creation Interface is provided by the Resource Host in order to enable the dynamic creation of new Sensei Resources. The Resource Creation interface provide currently one method called "deployResource" with a Resource Description Template and a set of parameters as arguments. The SENSEI specification is technology agnostic, so the Resource Host with an RCI can use various technologies.

Table of Contents

  1. Demonstrator
    1. Repository
    2. The Resource Host and the RCI
    3. The Averager Software
    4. The Client Software

Demonstrator

The demonstrator of the RCI is based on OSGi technology, namely the Equinox runtime. The services are realized with the Restlet framework and can be access using the RESTLET patterns. The OSGi runtime plus the Restlet framework represent the Resource Host. A REST interface for the RCI is available. With a POST message to the interface, new Resources can be deployed. In our example we create a new "Averager" Resource dynamically.

Repository

Check out the software from here

The Resource Host and the RCI

  1. The Software for the Resouce Host is available in the following versions:
    • Linux (gtk.x86)
    • Windows (win32.x86)
    • MacOS (cocoa.ppc)
  2. Change the directory to ResourceHost/?
  3. Unzip the content of your operating system
  4. Change to the directory ResourceHost? + Perhaps change the permission of the executable
  5. run the executable RCIResourceHost
  • A shell window pops up and the service is started.
    • In most cases, one gets an error as the Resource Directory is not running. The Resource directory is required to publish the Resource Description Templates.
  • Check that the RCI service is running with http://localhost:8182/reshost/rci . One gets an XML containing a list of running OSGi bundles.
    • sometimes the RCI is running remotely! Then change localhost to the IP adress

The Averager Software

  1. The Averager Software is available as a OSGI Software bundle.
  2. Find the software from the Repository (see above) under Averager/eu.neclab.sensei.processing.averager_1.0.0.jar
    • the location with the full path to the file is needed later

The Client Software

  1. A jar file containing clients to interact with the RCI REST interface is provided too.
  2. Find the jar file from the Repository (see above) under Client/rciresourcehostclient.jar
  3. The argument one uses for the averager location locks like file:///C:/temp/DynamicResourceCreation/Averager/eu.neclab.sensei.processing.averager_1.0.0.jar The path must be adjusted to your system
  4. Run the following commands
    1. Run the RCIGetClient
      java -cp rciresourcehostclient.jar eu.neclab.sensei.resourcehost.client.RCIGetClient -help
      java -cp rciresourcehostclient.jar eu.neclab.sensei.resourcehost.client.RCIGetClient 
      
    2. Run the RCIPostClient in order to start with the deployment
      java -cp rciresourcehostclient.jar eu.neclab.sensei.resourcehost.client.RCIPostClient -help
      java -cp rciresourcehostclient.jar eu.neclab.sensei.resourcehost.client.RCIPostClient file:///C:/temp/DynamicResourceCreation/Averager/eu.neclab.sensei.processing.averager_1.0.0.jar
      
      • In the shell windows of the Resource Host the progress can be observed.
        • In most cases, one gets an error as the Resource Directory is not running. The Resource directory is required to publish the Resource.
  5. Now the new bundle eu.neclab.sensei.processing.averager should be installed. Check this under http://localhost:8182/reshost/rci
Last modified 11 years ago Last modified on Mar 2, 2011, 9:16:20 AM