public final class OSGiAccess extends Object
It doesn't do anything outside of OSGi.
For internal use only. May be renamed or removed in a future release.
getInstance()
Modifier and Type | Class and Description |
---|---|
static class |
OSGiAccess.OSGiServletContext
This is internal class and is not intended to be used.
|
Modifier and Type | Method and Description |
---|---|
void |
addScannedClasses(Map<Long,Collection<Class<?>>> extenderClasses)
Adds scanned classes in active bundles.
|
static OSGiAccess |
getInstance()
Gets the singleton instance.
|
ServletContext |
getOsgiServletContext()
Gets a servlet context instance which is used to track registries which
are storage of scanned classes.
|
boolean |
hasInitializers()
Checks whether the servlet initializers are discovered.
|
void |
removeScannedClasses(Long bundleId)
Removes classes from the bundle identified by the
bundleId . |
void |
setServletContainerInitializers(Collection<Class<? extends ServletContainerInitializer>> contextInitializers)
Sets the discovered servlet context initializer classes.
|
public static OSGiAccess getInstance()
public ServletContext getOsgiServletContext()
This is not a real servlet context. It's just a proxied unique instance
which is used to be able to access registries in a generic way via some
getInstance(ServletContext)
method.
public void setServletContainerInitializers(Collection<Class<? extends ServletContainerInitializer>> contextInitializers)
The OSGi bundle tracker is used to scan all classes in bundles and it also scans flow-server module for servlet initializer classes. They are set using this method once they are collected.
contextInitializers
- servlet context initializer classespublic boolean hasInitializers()
true
if servlet initializers are set, false
otherwisepublic void addScannedClasses(Map<Long,Collection<Class<?>>> extenderClasses)
The map contains a bundle id as a key and classes discovered in the bundle as a value.
extenderClasses
- a map with discovered classes in active bundlespublic void removeScannedClasses(Long bundleId)
bundleId
.
When a bundle becomes inactive its classes should not be used anymore. This method removes the classes from the bundle from the collection of discovered classes.
bundleId
- the bundle identifierCopyright © 2023. All rights reserved.