use of org.mule.runtime.core.internal.config.CustomService in project mule by mulesoft.
the class SpringMuleContextServiceConfigurator method createLocalObjectStoreBeanDefinitions.
private void createLocalObjectStoreBeanDefinitions() {
AtomicBoolean anyBaseStoreWasRedefined = new AtomicBoolean(false);
OBJECT_STORE_NAME_TO_LOCAL_OBJECT_STORE_NAME.entrySet().forEach(objectStoreLocal -> customServiceRegistry.getOverriddenService(objectStoreLocal.getKey()).ifPresent(customService -> {
anyBaseStoreWasRedefined.set(true);
beanDefinitionRegistry.registerBeanDefinition(objectStoreLocal.getKey(), getCustomServiceBeanDefinition(customService));
}));
if (anyBaseStoreWasRedefined.get()) {
beanDefinitionRegistry.registerBeanDefinition(LOCAL_OBJECT_STORE_MANAGER, getBeanDefinitionBuilder(MuleObjectStoreManager.class).addPropertyValue("basePersistentStoreKey", OBJECT_LOCAL_STORE_PERSISTENT).addPropertyValue("baseTransientStoreKey", OBJECT_LOCAL_STORE_IN_MEMORY).getBeanDefinition());
} else {
beanDefinitionRegistry.registerAlias(OBJECT_STORE_MANAGER, LOCAL_OBJECT_STORE_MANAGER);
}
}
use of org.mule.runtime.core.internal.config.CustomService in project mule by mulesoft.
the class DefaultCustomizationServiceTestCase method registersCustomServiceClass.
@Test
public void registersCustomServiceClass() throws Exception {
final Class<String> serviceClass = String.class;
customizationService.registerCustomServiceClass(SERVICE_ID, serviceClass);
assertThat(customizationService.getCustomServices().size(), equalTo(1));
final CustomService customService = customizationService.getCustomServices().get(SERVICE_ID);
assertServiceClass(customService, serviceClass);
}
use of org.mule.runtime.core.internal.config.CustomService in project mule by mulesoft.
the class DefaultCustomizationServiceTestCase method registersCustomService.
@Test
public void registersCustomService() throws Exception {
final Object service = new Object();
customizationService.registerCustomServiceImpl(SERVICE_ID, service);
assertThat(customizationService.getCustomServices().size(), equalTo(1));
final CustomService customService = customizationService.getCustomServices().get(SERVICE_ID);
assertServiceInstance(customService, service);
}
use of org.mule.runtime.core.internal.config.CustomService in project mule by mulesoft.
the class DefaultCustomizationServiceTestCase method overridesDefaultServiceClass.
@Test
public void overridesDefaultServiceClass() throws Exception {
final Class<String> serviceClass = String.class;
customizationService.overrideDefaultServiceClass(SERVICE_ID, serviceClass);
final CustomService customService = customizationService.getOverriddenService(SERVICE_ID).get();
assertServiceClass(customService, serviceClass);
}
use of org.mule.runtime.core.internal.config.CustomService in project mule by mulesoft.
the class DefaultCustomizationServiceTestCase method overridesDefaultService.
@Test
public void overridesDefaultService() throws Exception {
final Object service = new Object();
customizationService.overrideDefaultServiceImpl(SERVICE_ID, service);
final CustomService customService = customizationService.getOverriddenService(SERVICE_ID).get();
assertServiceInstance(customService, service);
}
Aggregations