Search in sources :

Example 1 with ThreadContextProvider

use of org.eclipse.microprofile.context.spi.ThreadContextProvider in project quarkus by quarkusio.

the class SmallRyeContextPropagationRecorder method configureStaticInit.

public void configureStaticInit(List<ThreadContextProvider> discoveredProviders, List<ContextManagerExtension> discoveredExtensions) {
    // in the live-reload mode, the provider instance may be already set in the previous start
    if (ContextManagerProvider.INSTANCE.get() == null) {
        ContextManagerProvider contextManagerProvider = new SmallRyeContextManagerProvider();
        ContextManagerProvider.register(contextManagerProvider);
    }
    // do what config we can here, but we need the runtime executor service to finish
    builder = (SmallRyeContextManager.Builder) ContextManagerProvider.instance().getContextManagerBuilder();
    builder.withThreadContextProviders(discoveredProviders.toArray(new ThreadContextProvider[0]));
    builder.withContextManagerExtensions(discoveredExtensions.toArray(new ContextManagerExtension[0]));
}
Also used : ContextManagerExtension(org.eclipse.microprofile.context.spi.ContextManagerExtension) SmallRyeContextManager(io.smallrye.context.SmallRyeContextManager) ThreadContextProvider(org.eclipse.microprofile.context.spi.ThreadContextProvider) SmallRyeContextManagerProvider(io.smallrye.context.SmallRyeContextManagerProvider) SmallRyeContextManagerProvider(io.smallrye.context.SmallRyeContextManagerProvider) ContextManagerProvider(org.eclipse.microprofile.context.spi.ContextManagerProvider)

Aggregations

SmallRyeContextManager (io.smallrye.context.SmallRyeContextManager)1 SmallRyeContextManagerProvider (io.smallrye.context.SmallRyeContextManagerProvider)1 ContextManagerExtension (org.eclipse.microprofile.context.spi.ContextManagerExtension)1 ContextManagerProvider (org.eclipse.microprofile.context.spi.ContextManagerProvider)1 ThreadContextProvider (org.eclipse.microprofile.context.spi.ThreadContextProvider)1