use of org.mule.runtime.core.privileged.registry.RegistrationException in project mule by mulesoft.
the class SimpleRegistry method doRegisterObject.
/**
* {@inheritDoc}
*/
@Override
protected void doRegisterObject(String key, Object object, Object metadata) throws RegistrationException {
Object previous = doGet(key);
if (previous != null) {
if (logger.isDebugEnabled()) {
logger.debug(String.format("An entry already exists for key %s. It will be replaced", key));
}
unregisterObject(key);
}
doPut(key, object);
try {
getLifecycleManager().applyCompletedPhases(object);
} catch (MuleException e) {
throw new RegistrationException(e);
}
}
use of org.mule.runtime.core.privileged.registry.RegistrationException in project mule by mulesoft.
the class AbstractAsyncRequestReplyRequester method initialise.
@Override
public void initialise() throws InitialisationException {
name = format(NAME_TEMPLATE, storePrefix, muleContext.getConfiguration().getId(), getLocation().getRootContainerName());
MuleRegistry registry = ((MuleContextWithRegistries) muleContext).getRegistry();
store = ((ObjectStoreManager) registry.get(OBJECT_STORE_MANAGER)).createObjectStore(name, ObjectStoreSettings.builder().persistent(false).maxEntries(MAX_PROCESSED_GROUPS).entryTtl(UNCLAIMED_TIME_TO_LIVE).expirationInterval(UNCLAIMED_INTERVAL).build());
try {
notificationFirer = registry.lookupObject(NotificationDispatcher.class);
} catch (RegistrationException e) {
throw new InitialisationException(e, this);
}
}
use of org.mule.runtime.core.privileged.registry.RegistrationException in project mule by mulesoft.
the class ExtensionRegistry method registerConfigurationProvider.
/**
* Registers the given {@code configurationProvider} in the underlying {@link #registry}.
* <p>
* The {@code configurationProvider} is registered under a key matching its {@link ConfigurationProvider#getName()}.
*
* @param configurationProvider a {@link ConfigurationProvider} to be registered
* @param muleContext the owner of the registry to register the configurationProvider in.
* @throws IllegalArgumentException if {@code configurationProvider} is {@code null}
* @throws MuleRuntimeException if the {@code configurationProvider} could not be registered
*/
void registerConfigurationProvider(ConfigurationProvider configurationProvider, MuleContext muleContext) {
checkArgument(configurationProvider != null, "Cannot register a null configurationProvider");
try {
registerObject(muleContext, configurationProvider.getName(), configurationProvider);
} catch (RegistrationException e) {
throw new MuleRuntimeException(createStaticMessage(format("Found exception while registering configuration provider '%s'", configurationProvider.getName())), e);
}
providersByExtension.invalidate(configurationProvider.getExtensionModel());
}
Aggregations