public abstract class AbstractSpringRegistry extends AbstractRegistry implements SpringContextRegistry, Injector
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,org.springframework.beans.factory.config.BeanDefinition> |
registeredBeanDefinitionsBeforeInitialization |
static String |
REGISTRY_ID |
static String |
SPRING_APPLICATION_CONTEXT
Key used to lookup Spring Application Context from SpringRegistry via Mule's Registry interface.
|
protected AtomicBoolean |
springContextInitialised |
logger| Constructor and Description |
|---|
AbstractSpringRegistry(org.springframework.context.ApplicationContext applicationContext,
MuleContext muleContext,
LifecycleInterceptor lifecycleInterceptor) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addBeanFactoryPostProcessor(org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor postProcessor) |
Object |
applyLifecycle(Object object)
Will fire any lifecycle methods according to the current lifecycle without actually registering the object in the registry.
|
Object |
applyLifecycle(Object object,
String phase) |
void |
applyLifecycle(Object object,
String startPhase,
String toPhase) |
protected void |
applyLifecycleIfPrototype(Object object,
String key,
boolean applyLifecycle) |
protected LifecycleManager |
createLifecycleManager(LifecycleInterceptor lifecycleInterceptor) |
protected void |
disposeContext() |
void |
doDispose() |
protected void |
doInitialise() |
protected Object |
doUnregisterObject(String key) |
org.springframework.context.ApplicationContext |
getApplicationContext() |
abstract BeanDependencyResolver |
getBeanDependencyResolver() |
String[] |
getBeanNamesForType(Class<?> type) |
abstract ConfigurationDependencyResolver |
getConfigurationDependencyResolver() |
Map<String,Object> |
getDependencies(String key) |
protected <T> T |
initialiseObject(org.springframework.context.ConfigurableApplicationContext applicationContext,
String key,
T object) |
<T> T |
inject(T object) |
protected <T> Map<String,T> |
internalLookupByType(Class<T> type,
boolean nonSingletons,
boolean eagerInit) |
protected <T> Map<String,T> |
internalLookupByTypeWithoutAncestorsAndObjectProviders(Class<T> type,
boolean nonSingletons,
boolean eagerInit) |
protected <T> Map<String,T> |
internalLookupByTypeWithoutAncestorsAndObjectProviders(Class<T> type,
boolean nonSingletons,
boolean eagerInit,
org.springframework.context.ApplicationContext applicationCtx) |
protected boolean |
isNullBean(Object bean) |
boolean |
isReadOnly() |
boolean |
isRemote() |
boolean |
isSingleton(String key) |
<T> Map<String,T> |
lookupByType(Class<T> type) |
protected abstract <T> Map<String,T> |
lookupEntriesForLifecycleIncludingAncestors(Class<T> type) |
<T> Collection<T> |
lookupLocalObjects(Class<T> type) |
<T> T |
lookupObject(String key) |
Object |
lookupObject(String key,
boolean applyLifecycle)
If looks for the bean registered under
key. |
<T> Collection<T> |
lookupObjects(Class<T> type) |
<T> Collection<T> |
lookupObjectsForLifecycle(Class<T> type)
For lifecycle we only want spring to return singleton objects from it's application context
|
void |
registerObject(String key,
Object value) |
void |
registerObject(String key,
Object value,
Object metadata) |
void |
registerObjects(Map<String,Object> objects) |
protected void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
dispose, fireLifecycle, get, getLifecycleManager, getMuleContext, getRegistryId, initialise, isInitialised, lookupObject, unregisterObjectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfireLifecycle, get, getRegistryId, lookupObject, unregisterObjectpublic static final String REGISTRY_ID
public static final String SPRING_APPLICATION_CONTEXT
protected AtomicBoolean springContextInitialised
public AbstractSpringRegistry(org.springframework.context.ApplicationContext applicationContext,
MuleContext muleContext,
LifecycleInterceptor lifecycleInterceptor)
protected void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
public org.springframework.context.ApplicationContext getApplicationContext()
protected void addBeanFactoryPostProcessor(org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor postProcessor)
protected void doInitialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
doInitialise in class AbstractRegistryorg.mule.runtime.api.lifecycle.InitialisationExceptionpublic void doDispose()
doDispose in class AbstractRegistryprotected void disposeContext()
protected LifecycleManager createLifecycleManager(LifecycleInterceptor lifecycleInterceptor)
createLifecycleManager in class AbstractRegistrypublic <T> T lookupObject(String key)
lookupObject in interface RegistrylookupObject(String, boolean) with true as the second argumentpublic Object lookupObject(String key, boolean applyLifecycle)
key. If the returned bean is a prototype and applyLifecycle is
true, then the completed lifecycle phases are applied to the returning beanlookupObject in interface Registrykey - the key of the object you're looking forapplyLifecycle - if lifecycle should be applied to the returned object. Passing true doesn't guarantee that the
lifecycle is appliednull if not foundprotected final boolean isNullBean(Object bean)
protected final void applyLifecycleIfPrototype(Object object, String key, boolean applyLifecycle)
public <T> Collection<T> lookupObjects(Class<T> type)
lookupObjects in interface Registrypublic <T> Collection<T> lookupLocalObjects(Class<T> type)
lookupLocalObjects in interface Registrypublic <T> Collection<T> lookupObjectsForLifecycle(Class<T> type)
lookupObjectsForLifecycle in interface RegistrylookupObjectsForLifecycle in class AbstractRegistrypublic <T> Map<String,T> lookupByType(Class<T> type)
lookupByType in interface Registrypublic boolean isSingleton(String key)
isSingleton in interface Registrypublic void registerObject(String key, Object value) throws RegistrationException
registerObject in interface RegistryRegistrationExceptionpublic void registerObject(String key, Object value, Object metadata) throws RegistrationException
registerObject in interface RegistryRegistrationExceptionpublic void registerObjects(Map<String,Object> objects) throws RegistrationException
registerObjects in interface RegistryRegistrationExceptionprotected Object doUnregisterObject(String key) throws RegistrationException
doUnregisterObject in class AbstractRegistryRegistrationExceptionpublic Object applyLifecycle(Object object) throws org.mule.runtime.api.exception.MuleException
applyLifecycle in interface Registryobject - the object to processorg.mule.runtime.api.exception.MuleException - if the registry fails to perform the lifecycle change for the object.public Object applyLifecycle(Object object, String phase) throws org.mule.runtime.api.exception.MuleException
applyLifecycle in interface Registryorg.mule.runtime.api.exception.MuleExceptionpublic void applyLifecycle(Object object, String startPhase, String toPhase) throws org.mule.runtime.api.exception.MuleException
applyLifecycle in interface Registryorg.mule.runtime.api.exception.MuleExceptionprotected final <T> T initialiseObject(org.springframework.context.ConfigurableApplicationContext applicationContext,
String key,
T object)
throws org.mule.runtime.api.lifecycle.LifecycleException
org.mule.runtime.api.lifecycle.LifecycleExceptionprotected <T> Map<String,T> internalLookupByType(Class<T> type, boolean nonSingletons, boolean eagerInit)
protected abstract <T> Map<String,T> lookupEntriesForLifecycleIncludingAncestors(Class<T> type)
protected <T> Map<String,T> internalLookupByTypeWithoutAncestorsAndObjectProviders(Class<T> type, boolean nonSingletons, boolean eagerInit)
protected final <T> Map<String,T> internalLookupByTypeWithoutAncestorsAndObjectProviders(Class<T> type, boolean nonSingletons, boolean eagerInit, org.springframework.context.ApplicationContext applicationCtx)
public Map<String,Object> getDependencies(String key)
getDependencies in interface SpringContextRegistrykey - the bean to get dependencies for.key.ConfigurableBeanFactory.getDependenciesForBean(String)public abstract BeanDependencyResolver getBeanDependencyResolver()
public abstract ConfigurationDependencyResolver getConfigurationDependencyResolver()
public String[] getBeanNamesForType(Class<?> type)
getBeanNamesForType in interface SpringContextRegistryListableBeanFactory.getBeanNamesForType(Class)public boolean isReadOnly()
isReadOnly in interface RegistryCopyright © 2003–2022 MuleSoft, Inc.. All rights reserved.