Restlet Framework 2.2.1
OSGi Environments

org.restlet.ext.osgi
Class BaseDirectoryProvider

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

public class BaseDirectoryProvider
extends BaseRestletProvider
implements DirectoryProvider

This class provides an implementation of DirectoryProvider. You register this class as an OSGi declarative service. 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.directory">
   <implementation class="org.restlet.ext.osgi.BaseDirectoryProvider"/>
   <property name="path" type="String" value="/myDir"/>
   <property name="rootUri" type="String" value="file:/Path/to/dir"/>
   <service>
     <provide interface="org.restlet.ext.osgi.DirectoryProvider"/>
   </service>
 </scr:component>
 
 

The service properties are:

The referenced services are:

The provided services are:

Author:
Bryan Hunt

Constructor Summary
BaseDirectoryProvider()
           
 
Method Summary
 void activate(org.osgi.service.component.ComponentContext context)
          Called by OSGi DS to activate the service
protected  Directory createDirectory(Context context)
          Creates the Restlet Directory instance using the rootUri, indexName, deeplyAccessible, modifiable, and negotiatingContent service properties
protected  Restlet getFilteredRestlet()
          Called by getInboundRoot() to determine the filtered restlet that is next in the chain.
 Restlet getInboundRoot(Context context)
           
 String getPath()
           
 
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

BaseDirectoryProvider

public BaseDirectoryProvider()
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

createDirectory

protected Directory createDirectory(Context context)
Creates the Restlet Directory instance using the rootUri, indexName, deeplyAccessible, modifiable, and negotiatingContent service properties

Parameters:
context - the Restlet application context
Returns:
the configured Restlet Directory

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

getPath

public String getPath()
Specified by:
getPath in interface DirectoryProvider
Returns:
the fully qualified path of the directory

Restlet Framework 2.2.1
OSGi Environments

Copyright © 2005-2014 Restlet.