Package se.curity.identityserver.sdk
Class ClassLoaderContextUtils
Object
se.curity.identityserver.sdk.ClassLoaderContextUtils
Utility class for dealing with Jakarta EE functionality that requires loading services from a
ClassLoader
that includes Curity Plugins' classes.
This is needed, for example, when loading SOAP services (JAXB, JAX-WS etc.).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassLoaderContextUtilsCreate aClassLoaderContextUtilsinstance based on a class that is declared in a Curity Plugin.<T> TwithPluginClassLoader(Supplier<T> supplier) Run the given supplier such that the current contextClassLoaderis set to this Curity Plugin'sClassLoaderrather than the system loader.
-
Constructor Details
-
ClassLoaderContextUtils
-
-
Method Details
-
fromClass
Create aClassLoaderContextUtilsinstance based on a class that is declared in a Curity Plugin.- Parameters:
pluginClass- a class that is declared in a Curity Plugin.- Returns:
- new instance of
ClassLoaderContextUtilsfor the plugin that owns the given class.
-
withPluginClassLoader
Run the given supplier such that the current contextClassLoaderis set to this Curity Plugin'sClassLoaderrather than the system loader.Once this method returns, the context
ClassLoaderis restored to whatever value it was before this method was called.- Type Parameters:
T- type of return value- Parameters:
supplier- to run- Returns:
- value returned by the supplier
-