Package org.restlet.ext.osgi
Interface ApplicationProvider
-
- All Known Implementing Classes:
BaseApplicationProvider
public interface ApplicationProvider
This is an OSGi service interface for registering Restlet applications with a server servlet. Users are expected to register an instance as an OSGi service. It is recommended that you use theBaseApplicationProvider
implementation. You may extend it if necessary, or for complete control, provide your own implementation ofApplicationProvider
. A server servlet will be created and registered with the web container at the specified alias. The application will then be registered with the servlet.- Author:
- Bryan Hunt, Wolfgang Werner
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SERVLET_CONFIG_ATTRIBUTE
The key constant that may be used to look up theServletConfig
instance from the child contextstatic java.lang.String
SERVLET_CONTEXT_ATTRIBUTE
The key constant that may be used to look up theServletContext
instance from the child context
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.restlet.Application
createApplication(org.restlet.Context context)
java.lang.String
getAlias()
The alias is passed toHttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context)
when the servlet is registered.org.osgi.service.http.HttpContext
getContext()
The context is passed toHttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context)
when the servlet is registered.java.util.Dictionary<java.lang.String,java.lang.Object>
getInitParms()
The parameters are passed toHttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context)
when the servlet is registered.
-
-
-
Field Detail
-
SERVLET_CONFIG_ATTRIBUTE
static final java.lang.String SERVLET_CONFIG_ATTRIBUTE
The key constant that may be used to look up theServletConfig
instance from the child context- See Also:
- Constant Field Values
-
SERVLET_CONTEXT_ATTRIBUTE
static final java.lang.String SERVLET_CONTEXT_ATTRIBUTE
The key constant that may be used to look up theServletContext
instance from the child context- See Also:
- Constant Field Values
-
-
Method Detail
-
createApplication
org.restlet.Application createApplication(org.restlet.Context context)
- Returns:
- the application to be register at the specified alias.
-
getAlias
java.lang.String getAlias()
The alias is passed toHttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context)
when the servlet is registered.- Returns:
- the alias used to register with the server servlet.
-
getContext
org.osgi.service.http.HttpContext getContext()
The context is passed toHttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context)
when the servlet is registered.- Returns:
- the context to use with the server servlet.
-
getInitParms
java.util.Dictionary<java.lang.String,java.lang.Object> getInitParms()
The parameters are passed toHttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context)
when the servlet is registered.- Returns:
- the initialization parameters to use with the server servlet.
-
-