|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.httplite.osgi.HttpServiceImpl
public class HttpServiceImpl
The HTTP Service implementation that also implements RegistrationResolver to provide internal server classes with OSGi service registration data.
Constructor Summary | |
---|---|
HttpServiceImpl(org.osgi.framework.Bundle bundle,
Server server,
Logger logger,
java.util.Map servletMap)
|
Method Summary | |
---|---|
org.osgi.service.http.HttpContext |
createDefaultHttpContext()
|
ServiceRegistrationHandler |
getProcessor(HttpServletRequestImpl request,
HttpServletResponseImpl response,
java.lang.String requestPath)
For a request, response, and requestPath, return a ServiceRegistrationHandler. |
ServiceRegistration |
getServiceRegistration(java.lang.String requestPath)
Iterate through all service registrations and return the registration which matches the longest alias, or null if no matches are found. |
HttpServletRequestImpl |
getServletRequest(java.net.Socket socket)
Given a socket connection return a HttpServletRequestImpl. |
HttpServletResponseImpl |
getServletResponse(java.io.OutputStream output)
Given a HttpRequest and an output stream, return a HttpServletResponseImpl. |
void |
registerResources(java.lang.String alias,
java.lang.String name,
org.osgi.service.http.HttpContext context)
|
void |
registerServlet(java.lang.String alias,
javax.servlet.Servlet servlet,
java.util.Dictionary initparams,
org.osgi.service.http.HttpContext context)
|
protected void |
start()
Start the HTTP server. |
protected void |
stop()
Stop the HTTP server |
void |
unregister(java.lang.String alias)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpServiceImpl(org.osgi.framework.Bundle bundle, Server server, Logger logger, java.util.Map servletMap) throws java.io.IOException
server
- Map of bundle
- Bundle that registered with the servicelogger
- instance of LoggerservletMap
- Map of servlet instances.
java.io.IOException
Method Detail |
---|
public void registerResources(java.lang.String alias, java.lang.String name, org.osgi.service.http.HttpContext context) throws org.osgi.service.http.NamespaceException
registerResources
in interface org.osgi.service.http.HttpService
org.osgi.service.http.NamespaceException
public void unregister(java.lang.String alias)
unregister
in interface org.osgi.service.http.HttpService
public org.osgi.service.http.HttpContext createDefaultHttpContext()
createDefaultHttpContext
in interface org.osgi.service.http.HttpService
public void registerServlet(java.lang.String alias, javax.servlet.Servlet servlet, java.util.Dictionary initparams, org.osgi.service.http.HttpContext context) throws javax.servlet.ServletException, org.osgi.service.http.NamespaceException
registerServlet
in interface org.osgi.service.http.HttpService
javax.servlet.ServletException
org.osgi.service.http.NamespaceException
protected final void start() throws java.io.IOException
java.io.IOException
- on I/O errorprotected final void stop() throws java.lang.InterruptedException
java.lang.InterruptedException
- on thread interruption.public final ServiceRegistration getServiceRegistration(java.lang.String requestPath)
getServiceRegistration
in interface ServiceRegistrationResolver
requestPath
- the URI of the request
public ServiceRegistrationHandler getProcessor(HttpServletRequestImpl request, HttpServletResponseImpl response, java.lang.String requestPath)
ServiceRegistrationResolver
getProcessor
in interface ServiceRegistrationResolver
request
- HttpRequestresponse
- HttpResponserequestPath
- The request URI
public HttpServletRequestImpl getServletRequest(java.net.Socket socket)
ServiceRegistrationResolver
getServletRequest
in interface ServiceRegistrationResolver
socket
- socket connection to be associated with HTTP Request
public HttpServletResponseImpl getServletResponse(java.io.OutputStream output)
ServiceRegistrationResolver
getServletResponse
in interface ServiceRegistrationResolver
output
- output stream associated with socket connection.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |