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

# Class WhiteboardManager

java.lang.Object
org.apache.felix.http.base.internal.whiteboard.WhiteboardManager

public final class WhiteboardManager extends Object

## Constructor Summary

Constructors
Constructor
Description
`WhiteboardManager(org.osgi.framework.BundleContext bundleContext, HttpServiceFactory httpServiceFactory, HandlerRegistry registry)`
Create a new whiteboard http manager

## Method Summary

Modifier and Type
Method
Description
`boolean`
`addContextHelper(ServletContextHelperInfo info)`
Add a servlet context helper.
`boolean`
`addWhiteboardService(@NotNull WhiteboardServiceInfo<?> info)`
Add new whiteboard service to the registry
`RegistryRuntime`
`getRuntimeInfo()`
`void`
`invokePreprocessors(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res, org.osgi.service.servlet.whiteboard.Preprocessor dispatcher)`
Invoke all preprocessors
`void`
`removeContextHelper(ServletContextHelperInfo info)`
Remove a servlet context helper
`void`
`removeWhiteboardService(WhiteboardServiceInfo<?> info)`
Remove whiteboard service from the registry.
`void`
`sessionDestroyed(@NotNull jakarta.servlet.http.HttpSession session, Set<String> contextNames)`
`void`
`sessionIdChanged(@NotNull jakarta.servlet.http.HttpSessionEvent event, String oldSessionId, Set<String> contextNames)`
Handle session id changes
`void`
`setAttributeSharedServletContext(String key, Object value)`
Stores an attribute in the to be created shared servlet context.
`void`
`start(jakarta.servlet.ServletContext containerContext, @NotNull Dictionary<String,Object> httpServiceProps)`
Start the whiteboard manager
`void`
`stop()`
Stop the instance

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

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

## Constructor Details

### WhiteboardManager

public WhiteboardManager(org.osgi.framework.BundleContext bundleContext, HttpServiceFactory httpServiceFactory, HandlerRegistry registry)
Create a new whiteboard http manager

Parameters:
  `bundleContext` - The bundle context of the http bundle
  `httpServiceFactory` - The http service factory
  `registry` - The handler registry

## Method Details

### start

public void start(jakarta.servlet.ServletContext containerContext, @NotNull @NotNull Dictionary<String,Object> httpServiceProps)
Start the whiteboard manager

Parameters:
  `containerContext` - The servlet context
  `httpServiceProps` - Service registration properties

### stop

public void stop()
Stop the instance

### sessionDestroyed

public void sessionDestroyed(@NotNull @NotNull jakarta.servlet.http.HttpSession session, Set<String> contextNames)

### sessionIdChanged

public void sessionIdChanged(@NotNull @NotNull jakarta.servlet.http.HttpSessionEvent event, String oldSessionId, Set<String> contextNames)
Handle session id changes

Parameters:
  `event` - The session event
  `oldSessionId` - The old session id
  `contextNames` - The context names using that session

### addContextHelper

public boolean addContextHelper(ServletContextHelperInfo info)
Add a servlet context helper.

Parameters:
  `info` - The servlet context helper info
Returns:
  `true` if the service matches this http whiteboard service

### removeContextHelper

public void removeContextHelper(ServletContextHelperInfo info)
Remove a servlet context helper

Parameters:
  `info` - The servlet context helper info

### addWhiteboardService

public boolean addWhiteboardService(@NotNull @NotNull WhiteboardServiceInfo<?> info)
Add new whiteboard service to the registry

Parameters:
  `info` - Whiteboard service info
Returns:
  `true` if it matches this http service runtime

### removeWhiteboardService

public void removeWhiteboardService(WhiteboardServiceInfo<?> info)
Remove whiteboard service from the registry.

Parameters:
  `info` - The service id of the whiteboard service

### getRuntimeInfo

public RegistryRuntime getRuntimeInfo()

### invokePreprocessors

public void invokePreprocessors(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res, org.osgi.service.servlet.whiteboard.Preprocessor dispatcher) throws jakarta.servlet.ServletException, IOException
Invoke all preprocessors

Parameters:
  `req` - The request
  `res` - The response
  `dispatcher` - The dispatcher
Throws:
  `IOException` - If the invocation throws an IOException
  `jakarta.servlet.ServletException` - If the invocation throws a ServletException

### setAttributeSharedServletContext

public void setAttributeSharedServletContext(String key, Object value)
Stores an attribute in the to be created shared servlet context.

Parameters:
  `key` - attribute key
  `value` - attribute value