use of io.quarkus.runtime.RuntimeValue in project keycloak by keycloak.
the class KeycloakRecorder method createCacheInitializer.
public RuntimeValue<CacheManagerFactory> createCacheInitializer(String config, ShutdownContext shutdownContext) {
try {
CacheManagerFactory cacheManagerFactory = new CacheManagerFactory(config);
shutdownContext.addShutdownTask(new Runnable() {
@Override
public void run() {
DefaultCacheManager cacheManager = cacheManagerFactory.getOrCreate();
if (cacheManager != null) {
cacheManager.stop();
}
}
});
return new RuntimeValue<>(cacheManagerFactory);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of io.quarkus.runtime.RuntimeValue in project camunda-bpm-platform by camunda.
the class CamundaEngineRecorder method createProcessEngineConfiguration.
public RuntimeValue<ProcessEngineConfigurationImpl> createProcessEngineConfiguration(BeanContainer beanContainer, CamundaEngineConfig config) {
QuarkusProcessEngineConfiguration configuration = beanContainer.instance(QuarkusProcessEngineConfiguration.class);
// apply properties from config before any other configuration.
PropertyHelper.applyProperties(configuration, config.genericConfig, PropertyHelper.KEBAB_CASE);
if (configuration.getDataSource() == null) {
String datasource = config.datasource.orElse(DEFAULT_DATASOURCE_NAME);
configuration.setDataSource(DataSources.fromName(datasource));
}
if (configuration.getTransactionManager() == null) {
configuration.setTransactionManager(transactionManager());
}
// if not already configured by a custom configuration
if (configuration.getJobExecutor() == null) {
configureJobExecutor(configuration, config);
}
configureCdiEventBridge(configuration);
return new RuntimeValue<>(configuration);
}
use of io.quarkus.runtime.RuntimeValue in project quarkus-logging-logback by quarkiverse.
the class LogbackRecorder method createHandler.
public RuntimeValue<Optional<Handler>> createHandler() {
started = true;
for (DelayedStart i : DELAYED_START_HANDLERS) {
i.doQuarkusDelayedStart();
}
DELAYED_START_HANDLERS.clear();
return new RuntimeValue<>(Optional.of(new ExtHandler() {
@Override
public final void doPublish(final ExtLogRecord record) {
if (defaultLoggerContext == null) {
return;
}
Logger logger = defaultLoggerContext.getLogger(record.getLoggerName());
logger.callAppenders(new LoggingEventWrapper(record, getFormatter()));
}
@Override
public void flush() {
}
@Override
public void close() throws SecurityException {
}
}));
}
use of io.quarkus.runtime.RuntimeValue in project camel-quarkus by apache.
the class PlatformHttpRecorder method createComponent.
public RuntimeValue<PlatformHttpComponent> createComponent(RuntimeValue<PlatformHttpEngine> engine) {
PlatformHttpComponent component = new PlatformHttpComponent();
component.setEngine(engine.getValue());
return new RuntimeValue<>(component);
}
use of io.quarkus.runtime.RuntimeValue in project camel-quarkus by apache.
the class CamelMyBatisRecorder method createMyBatisBeanComponent.
public RuntimeValue<MyBatisBeanComponent> createMyBatisBeanComponent(RuntimeValue<SqlSessionFactory> sqlSessionFactory) {
MyBatisBeanComponent component = new MyBatisBeanComponent();
component.setSqlSessionFactory(sqlSessionFactory.getValue());
return new RuntimeValue<>(component);
}
Aggregations