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

# Class PerBundleHttpServiceImpl

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

All Implemented Interfaces:
  `org.osgi.service.http.HttpService`

public final class PerBundleHttpServiceImpl extends Object implements org.osgi.service.http.HttpService
This implementation of the `HttpService` implements the front end used by client bundles. It performs the validity checks and passes the real operation to the shared http service.

## Constructor Summary

Constructors
Constructor
Description
`PerBundleHttpServiceImpl(org.osgi.framework.Bundle bundle, SharedHttpServiceImpl sharedHttpService, jakarta.servlet.ServletContext context, boolean sharedContextAttributes)`
Create a new http service front end

## Method Summary

Modifier and Type
Method
Description
`org.osgi.service.http.HttpContext`
`createDefaultHttpContext()`
`@NotNull ExtServletContext`
`getServletContext(org.osgi.service.http.HttpContext context)`
Get a servlet context
`void`
`registerResources(String alias, String name, org.osgi.service.http.HttpContext context)`
No need to sync this method, syncing is done via `registerServlet(String, javax.servlet.Servlet, Dictionary, HttpContext)`
`void`
`registerServlet(String alias, javax.servlet.Servlet servlet, Dictionary initParams, org.osgi.service.http.HttpContext context)`
`void`
`unregister(String alias)`
`void`
`unregisterAll()`
Remove all registered servlets

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

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

## Constructor Details

### PerBundleHttpServiceImpl

public PerBundleHttpServiceImpl(org.osgi.framework.Bundle bundle, SharedHttpServiceImpl sharedHttpService, jakarta.servlet.ServletContext context, boolean sharedContextAttributes)
Create a new http service front end

Parameters:
  `bundle` - The using bundle
  `sharedHttpService` - The shared service
  `context` - The context
  `sharedContextAttributes` - Shared context attributes?

## Method Details

### createDefaultHttpContext

public org.osgi.service.http.HttpContext createDefaultHttpContext()

Specified by:
  `createDefaultHttpContext` in interface `org.osgi.service.http.HttpService`

### registerResources

public void registerResources(String alias, String name, org.osgi.service.http.HttpContext context) throws org.osgi.service.http.NamespaceException
No need to sync this method, syncing is done via `registerServlet(String, javax.servlet.Servlet, Dictionary, HttpContext)`

Specified by:
  `registerResources` in interface `org.osgi.service.http.HttpService`
Throws:
  `org.osgi.service.http.NamespaceException`
See Also:
  - `HttpService.registerResources(java.lang.String, java.lang.String, org.osgi.service.http.HttpContext)`

### registerServlet

public void registerServlet(String alias, javax.servlet.Servlet servlet, Dictionary initParams, org.osgi.service.http.HttpContext context) throws javax.servlet.ServletException, org.osgi.service.http.NamespaceException

Specified by:
  `registerServlet` in interface `org.osgi.service.http.HttpService`
Throws:
  `javax.servlet.ServletException`
  `org.osgi.service.http.NamespaceException`
See Also:
  - `HttpService.registerServlet(java.lang.String, javax.servlet.Servlet, java.util.Dictionary, org.osgi.service.http.HttpContext)`

### unregister

public void unregister(String alias)

Specified by:
  `unregister` in interface `org.osgi.service.http.HttpService`
See Also:
  - `HttpService.unregister(java.lang.String)`

### unregisterAll

public void unregisterAll()
Remove all registered servlets

### getServletContext

@NotNull public @NotNull ExtServletContext getServletContext(org.osgi.service.http.HttpContext context)
Get a servlet context

Parameters:
  `context` - http context
Returns:
  servlet context