org.mule.registry
Class TransientRegistry

java.lang.Object
  extended by org.mule.registry.AbstractRegistry
      extended by org.mule.registry.TransientRegistry
All Implemented Interfaces:
Disposable, Initialisable, Registry

public class TransientRegistry
extends AbstractRegistry

Use synchronized(registry) when reading/writing/iterating over the contents of the registry hashmap.


Field Summary
protected  Log logger
          logger used by this class
static String REGISTRY_ID
           
 
Fields inherited from class org.mule.registry.AbstractRegistry
lifecycleManager, muleContext
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
TransientRegistry(MuleContext muleContext)
           
TransientRegistry(String id, MuleContext muleContext)
           
 
Method Summary
protected  Map applyProcessors(Map<String,Object> objects)
           
protected  void checkDisposed()
           
protected  void doDispose()
           
protected  void doInitialise()
           
protected  boolean hasFlag(Object metaData, int flag)
           
 boolean isReadOnly()
           
 boolean isRemote()
           
<T> Map<String,T>
lookupByType(Class<T> type)
           
<T> T
lookupObject(String key)
          Look up a single object by name.
<T> Collection<T>
lookupObjects(Class<T> returntype)
          Look up all objects of a given type.
 void registerObject(String key, Object value)
          Allows for arbitary registration of transient objects
 void registerObject(String key, Object object, Object metadata)
          Allows for arbitrary registration of transient objects
 void registerObjects(Map objects)
           
 void unregisterObject(String key)
           
 void unregisterObject(String key, Object metadata)
           
 
Methods inherited from class org.mule.registry.AbstractRegistry
createLifecycleManager, dispose, fireLifecycle, get, getLifecycleManager, getRegistryId, initialise, lookupObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final transient Log logger
logger used by this class


REGISTRY_ID

public static final String REGISTRY_ID
See Also:
Constant Field Values
Constructor Detail

TransientRegistry

public TransientRegistry(MuleContext muleContext)

TransientRegistry

public TransientRegistry(String id,
                         MuleContext muleContext)
Method Detail

doInitialise

protected void doInitialise()
                     throws InitialisationException
Specified by:
doInitialise in class AbstractRegistry
Throws:
InitialisationException

doDispose

protected void doDispose()
Specified by:
doDispose in class AbstractRegistry

applyProcessors

protected Map applyProcessors(Map<String,Object> objects)

registerObjects

public void registerObjects(Map objects)
                     throws RegistrationException
Throws:
RegistrationException

lookupByType

public <T> Map<String,T> lookupByType(Class<T> type)
Returns:
key/object pairs

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

lookupObjects

public <T> Collection<T> lookupObjects(Class<T> returntype)
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
Allows for arbitary registration of transient objects

Parameters:
key -
value -
Throws:
RegistrationException

registerObject

public void registerObject(String key,
                           Object object,
                           Object metadata)
                    throws RegistrationException
Allows for arbitrary registration of transient objects

Parameters:
key -
Throws:
RegistrationException

checkDisposed

protected void checkDisposed()
                      throws RegistrationException
Throws:
RegistrationException

hasFlag

protected boolean hasFlag(Object metaData,
                          int flag)

unregisterObject

public void unregisterObject(String key,
                             Object metadata)
                      throws RegistrationException
Throws:
RegistrationException

unregisterObject

public void unregisterObject(String key)
                      throws RegistrationException
Throws:
RegistrationException

isReadOnly

public boolean isReadOnly()

isRemote

public boolean isRemote()


Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.