public class SpringRegistry extends AbstractRegistry implements LifecycleRegistry, Injector
| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.context.ApplicationContext |
applicationContext |
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 |
lifecycleManager, logger, muleContextPHASE_NAMEPHASE_NAME| Constructor and Description |
|---|
SpringRegistry(org.springframework.context.ApplicationContext applicationContext,
MuleContext muleContext) |
SpringRegistry(org.springframework.context.ConfigurableApplicationContext applicationContext,
org.springframework.context.ApplicationContext parentContext,
MuleContext muleContext) |
SpringRegistry(String id,
org.springframework.context.ApplicationContext applicationContext,
MuleContext muleContext) |
SpringRegistry(String id,
org.springframework.context.ConfigurableApplicationContext applicationContext,
org.springframework.context.ApplicationContext parentContext,
MuleContext muleContext) |
| Modifier and Type | Method and Description |
|---|---|
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) |
protected RegistryLifecycleManager |
createLifecycleManager() |
void |
doDispose() |
protected void |
doInitialise() |
protected Object |
doUnregisterObject(String key) |
protected Map<String,Object> |
getDepencies(String key) |
<T> T |
inject(T object) |
protected <T> Map<String,T> |
internalLookupByType(Class<T> type,
boolean nonSingletons,
boolean eagerInit) |
protected <T> Map<String,T> |
internalLookupByTypeWithoutAncestors(Class<T> type,
boolean nonSingletons,
boolean eagerInit) |
boolean |
isReadOnly() |
boolean |
isRemote() |
<T> Map<String,T> |
lookupByType(Class<T> type) |
protected <T> Map<String,T> |
lookupEntriesForLifecycle(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) |
dispose, fireLifecycle, get, getLifecycleManager, getRegistryId, initialise, isInitialised, lookupObject, unregisterObject, unregisterObjectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfireLifecycle, get, getRegistryId, lookupObject, unregisterObject, unregisterObjectinitialisedisposepublic static final String REGISTRY_ID
public static final String SPRING_APPLICATION_CONTEXT
protected org.springframework.context.ApplicationContext applicationContext
protected AtomicBoolean springContextInitialised
public SpringRegistry(org.springframework.context.ApplicationContext applicationContext,
MuleContext muleContext)
public SpringRegistry(String id, org.springframework.context.ApplicationContext applicationContext, MuleContext muleContext)
public SpringRegistry(org.springframework.context.ConfigurableApplicationContext applicationContext,
org.springframework.context.ApplicationContext parentContext,
MuleContext muleContext)
public SpringRegistry(String id, org.springframework.context.ConfigurableApplicationContext applicationContext, org.springframework.context.ApplicationContext parentContext, MuleContext muleContext)
protected void doInitialise()
throws InitialisationException
doInitialise in class AbstractRegistryInitialisationExceptionpublic void doDispose()
doDispose in class AbstractRegistryprotected RegistryLifecycleManager createLifecycleManager()
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 LifecycleRegistrykey - 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 foundpublic <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 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 MuleException
applyLifecycle in interface LifecycleRegistryobject - the object to processMuleException - if the registry fails to perform the lifecycle change for the object.public Object applyLifecycle(Object object, String phase) throws MuleException
applyLifecycle in interface LifecycleRegistryMuleExceptionprotected <T> Map<String,T> internalLookupByType(Class<T> type, boolean nonSingletons, boolean eagerInit)
protected <T> Map<String,T> internalLookupByTypeWithoutAncestors(Class<T> type, boolean nonSingletons, boolean eagerInit)
public boolean isReadOnly()
isReadOnly in interface RegistryCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.