|
Restlet Framework 2.2.2 OSGi Environments |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.ext.osgi.BaseApplicationProvider
public class BaseApplicationProvider
This class provides an implementation of ApplicationProvider
. 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">
<implementation class="org.restlet.ext.osgi.BaseApplicationProvider"/>
<property name="alias" type="String" value="/"/>
<reference bind="bindRouterProvider" cardinality="1..1" interface="org.restlet.ext.osgi.RouterProvider" name="RouterProvider" policy="static" unbind="unbindRouterProvider"/>
<service>
<provide interface="org.restlet.ext.osgi.ApplicationProvider"/>
</service>
</scr:component>
The service properties are:
The referenced services are:
The provided services are:
Field Summary |
---|
Fields inherited from interface org.restlet.ext.osgi.ApplicationProvider |
---|
SERVLET_CONFIG_ATTRIBUTE, SERVLET_CONTEXT_ATTRIBUTE |
Constructor Summary | |
---|---|
BaseApplicationProvider()
|
Method Summary | |
---|---|
void |
activate(org.osgi.service.component.ComponentContext context)
Called by OSGi DS to activate the service after the router provider has been bound |
void |
bindRouterProvider(RouterProvider routerProvider)
Called by OSGi DS to inject the router provider service |
Application |
createApplication(Context context)
|
protected Application |
doCreateApplication(Context context)
Called to construct the actual application instance. |
String |
getAlias()
The alias is passed to HttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context)
when the servlet is registered. |
Application |
getApplication()
Accessor for the cached application instance |
org.osgi.service.http.HttpContext |
getContext()
The context is passed to HttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context)
when the servlet is registered. |
Dictionary<String,Object> |
getInitParms()
The parameters are passed to HttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context)
when the servlet is registered. |
void |
unbindRouterProvider(RouterProvider routerProvider)
Called by OSGi DS to un-inject the router provider service |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseApplicationProvider()
Method Detail |
---|
public void activate(org.osgi.service.component.ComponentContext context)
context
- the OSGi component contextpublic void bindRouterProvider(RouterProvider routerProvider)
routerProvider
- the router provider servicepublic Application createApplication(Context context)
createApplication
in interface ApplicationProvider
protected Application doCreateApplication(Context context)
context
- the Restlet application context
public String getAlias()
ApplicationProvider
HttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context)
when the servlet is registered.
getAlias
in interface ApplicationProvider
public Application getApplication()
public org.osgi.service.http.HttpContext getContext()
ApplicationProvider
HttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context)
when the servlet is registered.
getContext
in interface ApplicationProvider
public Dictionary<String,Object> getInitParms()
ApplicationProvider
HttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context)
when the servlet is registered.
getInitParms
in interface ApplicationProvider
public void unbindRouterProvider(RouterProvider routerProvider)
routerProvider
- the router provider service
|
Restlet Framework 2.2.2 OSGi Environments |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |