Package org.apache.felix.http.base.internal.service

# Class SharedHttpServiceImpl

java.lang.Object
org.apache.felix.http.base.internal.service.SharedHttpServiceImpl

public final class SharedHttpServiceImpl extends Object
Shared http service implementation This implementation is shared by all bundles using the http service.

## Constructor Summary

Constructors
Constructor
Description
`SharedHttpServiceImpl(HandlerRegistry handlerRegistry)`
Create a new implementation

## Method Summary

Modifier and Type
Method
Description
`@NotNull HandlerRegistry`
`getHandlerRegistry()`
Get the handler registry
`void`
`registerServlet(@NotNull String alias, @NotNull ExtServletContext httpContext, javax.servlet.Servlet servlet, @NotNull ServletInfo servletInfo)`
Register a servlet
`void`
`setSharedContextAttributes(Map<String,Object> attributesForSharedContext)`
`javax.servlet.Servlet`
`unregister(String alias)`
Unregister a servlet
`void`
`unregisterServlet(javax.servlet.Servlet servlet)`
Unregister a servlet

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SharedHttpServiceImpl

public SharedHttpServiceImpl(HandlerRegistry handlerRegistry)
Create a new implementation

Parameters:
  `handlerRegistry` - The handler registry

## Method Details

### registerServlet

public void registerServlet(@NotNull @NotNull String alias, @NotNull @NotNull ExtServletContext httpContext, @NotNull javax.servlet.Servlet servlet, @NotNull @NotNull ServletInfo servletInfo) throws javax.servlet.ServletException, org.osgi.service.http.NamespaceException
Register a servlet

Parameters:
  `alias` - The alias
  `httpContext` - The servlet context
  `servlet` - The servlet
  `servletInfo` - The info for the servlet
Throws:
  `javax.servlet.ServletException` - If registration fails
  `org.osgi.service.http.NamespaceException` - If a servlet for the same alias already exists

### unregister

public javax.servlet.Servlet unregister(String alias)
Unregister a servlet

Parameters:
  `alias` - The alias
Returns:
  The servlet or `null`
See Also:
  - `HttpService.unregister(java.lang.String)`

### unregisterServlet

public void unregisterServlet(javax.servlet.Servlet servlet)
Unregister a servlet

Parameters:
  `servlet` - The servlet

### getHandlerRegistry

@NotNull public @NotNull HandlerRegistry getHandlerRegistry()
Get the handler registry

Returns:
  The registry

### setSharedContextAttributes

public void setSharedContextAttributes(Map<String,Object> attributesForSharedContext)