public void registerObject(String key, Object object, Object metadata) throws RegistrationException
{
checkDisposed();
if (StringUtils.isBlank(key))
{
throw new RegistrationException(MessageFactory.createStaticMessage("Attempt to register object with no key"));
}
if (logger.isDebugEnabled())
{
logger.debug(String.format("registering key/object %s/%s", key, object));
}
logger.debug("applying processors");
object = applyProcessors(object, metadata);
if (object == null)
{
return;
}
registryMap.putAndLogWarningIfDuplicate(key, object);
try
{
if (!hasFlag(metadata, MuleRegistry.LIFECYCLE_BYPASS_FLAG))
{
if(logger.isDebugEnabled())
{
logger.debug("applying lifecycle to object: " + object);
}
getLifecycleManager().applyCompletedPhases(object);
}
}
catch (MuleException e)
{
throw new RegistrationException(e);
}
}