Restlet Framework 2.2.1
OSGi Environments

org.restlet.ext.osgi
Class BaseResourceProvider

java.lang.Object
  extended by org.restlet.ext.osgi.BaseRestletProvider
      extended by org.restlet.ext.osgi.BaseResourceProvider
All Implemented Interfaces:
ResourceProvider, RestletProvider

public abstract class BaseResourceProvider
extends BaseRestletProvider
implements ResourceProvider

This class provides an implementation of ResourceProvider. You register this class as an OSGi declarative service. It is expected that clients will extend this class to create the Finder for the resource. This allows the OSGi class loading mechanism to properly locate the resource class. The service declaration should look like:

 <?xml version="1.0" encoding="UTF-8"?>
 <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.example.app.resource">
   <implementation class="org.restlet.ext.osgi.BaseResourceProvider"/>
   <service>
     <provide interface="org.restlet.ext.osgi.ResourceProvider"/>
   </service>
 </scr:component>
 
 

The service properties are:

The referenced services are:

The provided services are:

Author:
Bryan Hunt

Constructor Summary
BaseResourceProvider()
           
 
Method Summary
 void activate(org.osgi.service.component.ComponentContext context)
          Called by OSGi DS to activate the service
protected abstract  Finder createFinder(Context context)
           
protected  Restlet getFilteredRestlet()
          Called by getInboundRoot() to determine the filtered restlet that is next in the chain.
 Restlet getInboundRoot(Context context)
           
 int getMatchingMode()
           
 String[] getPaths()
           
 
Methods inherited from class org.restlet.ext.osgi.BaseRestletProvider
bindFilterProvider, unbindFilterProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseResourceProvider

public BaseResourceProvider()
Method Detail

activate

public void activate(org.osgi.service.component.ComponentContext context)
Called by OSGi DS to activate the service

Parameters:
context - the OSGi service context

createFinder

protected abstract Finder createFinder(Context context)
Parameters:
the - restlet application context
Returns:
the finder for the resource

getFilteredRestlet

protected Restlet getFilteredRestlet()
Description copied from class: BaseRestletProvider
Called by getInboundRoot() to determine the filtered restlet that is next in the chain.

Specified by:
getFilteredRestlet in class BaseRestletProvider
Returns:
the restlet to be filtered

getInboundRoot

public Restlet getInboundRoot(Context context)
Specified by:
getInboundRoot in interface RestletProvider
Overrides:
getInboundRoot in class BaseRestletProvider
Parameters:
context - the Restlet application context
Returns:
the node to be used as the inbound root of the handling chain

getPaths

public String[] getPaths()
Specified by:
getPaths in interface ResourceProvider
Returns:
the paths to the resource relative to the application alias. The paths must start with '/'.

getMatchingMode

public int getMatchingMode()
Specified by:
getMatchingMode in interface ResourceProvider
Returns:
the matching mode to be used for template routes. Defaults to Template.MODE_EQUALS.

Restlet Framework 2.2.1
OSGi Environments

Copyright © 2005-2014 Restlet.