|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ow2.jonas.web.base.osgi.httpservice.DefaultHttpContextImpl
public class DefaultHttpContextImpl
Default OSGI HttpContext returned by HttpServiceImpl#createDefaultHttpContext()
.
Field Summary |
---|
Fields inherited from interface org.osgi.service.http.HttpContext |
---|
AUTHENTICATION_TYPE, AUTHORIZATION, REMOTE_USER |
Constructor Summary | |
---|---|
DefaultHttpContextImpl(org.osgi.framework.Bundle bundle)
Constructor. |
Method Summary | |
---|---|
String |
getMimeType(String file)
Maps a name to a MIME type. |
URL |
getResource(String name)
Maps a resource name to a URL. |
boolean |
handleSecurity(HttpServletRequest request,
HttpServletResponse response)
Handles security for the specified request. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultHttpContextImpl(org.osgi.framework.Bundle bundle)
bundle
- the bundle that will be used to get resources.Method Detail |
---|
public String getMimeType(String file)
ServletContext
method getMimeType
. For
resource registrations, the Http Service will call this method to
determine the MIME type for the Content-Type header in the response.
getMimeType
in interface org.osgi.service.http.HttpContext
file
- determine the MIME type for this name.
null
to indicate that the Http Service should determine the MIME type
itself.public URL getResource(String name)
Called by the Http Service to map a resource name to a URL. For servlet
registrations, Http Service will call this method to support the
ServletContext
methods getResource
and
getResourceAsStream
. For resource registrations, Http Service
will call this method to locate the named resource.
The resource is mapped to a resource in
the context's bundle via bundle.getResource(name)
getResource
in interface org.osgi.service.http.HttpContext
name
- the name of the requested resource
null
if the resource does not exist.public boolean handleSecurity(HttpServletRequest request, HttpServletResponse response) throws IOException
The Http Service calls this method prior to servicing the specified request. This method controls whether the request is processed in the normal manner or an error is returned.
handleSecurity
in interface org.osgi.service.http.HttpContext
request
- the HTTP requestresponse
- the HTTP response
true
if the request should be serviced, false
if the request should not be serviced and Http Service will send
the response back to the client.
This implementation always returns true
.
IOException
- may be thrown by this method. If this
occurs, the Http Service will terminate the request and close
the socket.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |