org.mule.module.guice
Class GuiceRegistry
java.lang.Object
org.mule.registry.AbstractRegistry
org.mule.module.guice.GuiceRegistry
- All Implemented Interfaces:
- Disposable, Initialisable, Registry
public class GuiceRegistry
- extends AbstractRegistry
The internal Mule interface for retreiving objects from a Guice injector. This registry is read-only since all
objects should be configured by 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.
- See Also:
AbstractMuleGuiceModule,
GuiceModuleFactory
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GuiceRegistry
public GuiceRegistry(MuleContext muleContext)
doInitialise
protected void doInitialise()
throws InitialisationException
- Specified by:
doInitialise in class AbstractRegistry
- Throws:
InitialisationException
doDispose
protected void doDispose()
- Specified by:
doDispose in class AbstractRegistry
lookupObject
public <T> T lookupObject(String key)
- Description copied from interface:
Registry
- Look up a single object by name.
- Returns:
- object or null if not found
get
public <T> T get(String key)
- Description copied from interface:
Registry
- Alias method performing the lookup, here to simplify syntax when called from dynamic languages.
- Specified by:
get in interface Registry- Overrides:
get in class AbstractRegistry
lookupByType
public <T> Map<String,T> lookupByType(Class<T> type)
- Returns:
- key/object pairs
lookupObjects
public <T> Collection<T> lookupObjects(Class<T> type)
- Description copied from interface:
Registry
- Look up all objects of a given type.
- Returns:
- collection of objects or empty collection if none found
registerObject
public void registerObject(String key,
Object value)
throws RegistrationException
- Throws:
RegistrationException
registerObject
public void registerObject(String key,
Object value,
Object metadata)
throws RegistrationException
- Throws:
RegistrationException
registerObjects
public void registerObjects(Map objects)
throws RegistrationException
- Throws:
RegistrationException
unregisterObject
public void unregisterObject(String key)
throws RegistrationException
- Throws:
RegistrationException
unregisterObject
public void unregisterObject(String key,
Object metadata)
throws RegistrationException
- Throws:
RegistrationException
isReadOnly
public boolean isReadOnly()
isRemote
public boolean isRemote()
Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.