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 the BaseApplicationProvider implementation. You may extend it if necessary, or for complete control, provide your own implementation of ApplicationProvider. 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
static String SERVLET_CONFIG_ATTRIBUTE
          The key constant that may be used to look up the ServletConfig instance from the child context
static String SERVLET_CONTEXT_ATTRIBUTE
          The key constant that may be used to look up the ServletContext instance from the child context
 
Method Summary
 Application createApplication(Context context)
           
 String getAlias()
          The alias is passed to HttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context) when the servlet is registered.
 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.
 

Field Detail

SERVLET_CONFIG_ATTRIBUTE

static final String SERVLET_CONFIG_ATTRIBUTE
The key constant that may be used to look up the ServletConfig instance from the child context

See Also:
Constant Field Values

SERVLET_CONTEXT_ATTRIBUTE

static final String SERVLET_CONTEXT_ATTRIBUTE
The key constant that may be used to look up the ServletContext instance from the child context

See Also:
Constant Field Values
Method Detail

createApplication

Application createApplication(Context context)
Returns:
the application to be register at the specified alias.

getAlias

String getAlias()
The alias is passed to HttpService.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 to HttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context) when the servlet is registered.

Returns:
the context to use with the server servlet.

getInitParms

Dictionary<String,Object> getInitParms()
The parameters are passed to HttpService.registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context) when the servlet is registered.

Returns:
the initialization parameters to use with the server servlet.


Copyright © 2005-2014 Restlet.