@Deprecated public class GuiceRegistry extends AbstractRegistry
Module
objects. The lifecycle of objects will be
managed by Mule since Guice does not provide lifecycle support.
To create modules extend the AbstractMuleGuiceModule
since it provides hooks and helpers for
working with Mule configuration. Any modules independent of Mule can just extend the Guice AbstractModule
as normal.
Mule will discover modules on the classpath, if you need to configure a module before passing it to the Guice injector you
need to implement a GuiceModuleFactory
for your module.AbstractMuleGuiceModule
,
GuiceModuleFactory
lifecycleManager, logger, muleContext
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
GuiceRegistry(MuleContext muleContext)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doDispose()
Deprecated.
|
protected void |
doInitialise()
Deprecated.
|
protected Object |
doUnregisterObject(String key)
Deprecated.
Template method for the logic to actually unregister the key without applying any lifecycle to it.
|
boolean |
isReadOnly()
Deprecated.
|
boolean |
isRemote()
Deprecated.
|
<T> Map<String,T> |
lookupByType(Class<T> type)
Deprecated.
|
<T> Collection<T> |
lookupLocalObjects(Class<T> type)
Deprecated.
Look up all objects of a given type within the local registry.
|
<T> T |
lookupObject(Class<T> type)
Deprecated.
Look up a single object by type.
|
<T> T |
lookupObject(String key)
Deprecated.
Look up a single object by name.
|
<T> Collection<T> |
lookupObjects(Class<T> type)
Deprecated.
Look up all objects of a given type.
|
void |
registerObject(String key,
Object value)
Deprecated.
Registers an object in the registry with a key.
|
void |
registerObject(String key,
Object value,
Object metadata)
Deprecated.
Registers an object in the registry with a key.
|
void |
registerObjects(Map objects)
Deprecated.
Registers a Map of objects into the registry
|
createLifecycleManager, dispose, fireLifecycle, get, getLifecycleManager, getRegistryId, initialise, isInitialised, lookupObjectsForLifecycle, unregisterObject, unregisterObject
public GuiceRegistry(MuleContext muleContext)
protected void doInitialise() throws InitialisationException
doInitialise
in class AbstractRegistry
InitialisationException
protected void doDispose()
doDispose
in class AbstractRegistry
public <T> T lookupObject(String key)
Registry
public <T> T lookupObject(Class<T> type) throws RegistrationException
Registry
lookupObject
in interface Registry
lookupObject
in class AbstractRegistry
RegistrationException
- if more than one object is found.public <T> Map<String,T> lookupByType(Class<T> type)
public <T> Collection<T> lookupObjects(Class<T> type)
Registry
public <T> Collection<T> lookupLocalObjects(Class<T> type)
Registry
public void registerObject(String key, Object value) throws RegistrationException
Registry
key
- the key to store the value against. This is a non-null valuevalue
- the object to store in the registry. This is a non-null valueRegistrationException
- if an object with the same key already existspublic void registerObject(String key, Object value, Object metadata) throws RegistrationException
Registry
key
- the key to store the value against. This is a non-null valuevalue
- the object to store in the registry. This is a non-null valuemetadata
- an implementation specific argument that can be passed into the methodRegistrationException
- if an object with the same key already existspublic void registerObjects(Map objects) throws RegistrationException
Registry
objects
- a map of key value pairs, each will individually be registered in the registryRegistrationException
- if an object with the same key already existsprotected Object doUnregisterObject(String key) throws RegistrationException
AbstractRegistry
AbstractRegistry.unregisterObject(String)
doUnregisterObject
in class AbstractRegistry
key
- the key of the object to be unregistered objectkey
RegistrationException
public boolean isReadOnly()
public boolean isRemote()
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.