pt.digitalis.utils.ioc
Class AbstractIoCRegistryImpl

java.lang.Object
  extended by pt.digitalis.utils.ioc.AbstractIoCRegistryImpl
All Implemented Interfaces:
IIoCRegistry
Direct Known Subclasses:
IoCRegistryGuiceImpl

public abstract class AbstractIoCRegistryImpl
extends Object
implements IIoCRegistry

This class provides common implementations for some interface methods. It's not possible do use IoC to provide an abstraction of itself, so the Bridge DP was used to decouple the abstraction from it's implementation. The actual registry is created with the proper implementation according to the default DiF core configuration.

Author:
Pedro Viegas pviegas@digitalis.pt, Rodrigo Gonçalves rgoncalves@digitalis.pt

Field Summary
protected static IIoCRegistry instance
          The IoC registry instance.
 
Constructor Summary
AbstractIoCRegistryImpl()
           
 
Method Summary
 void discoverModules(ModuleParser searchMode)
          Finds and returns the declared Modules.
<T> List<T>
getImplementations(Class<T> serviceClass)
          Returns the list of implementations for the given interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface pt.digitalis.utils.ioc.IIoCRegistry
getImplementation, getImplementation, getImplementationsMap, injectDependencies
 

Field Detail

instance

protected static IIoCRegistry instance
The IoC registry instance.

Constructor Detail

AbstractIoCRegistryImpl

public AbstractIoCRegistryImpl()
Method Detail

discoverModules

public void discoverModules(ModuleParser searchMode)
                     throws ResourceNotFoundException
Finds and returns the declared Modules.

Parameters:
searchMode - module parsing mode
Throws:
ResourceNotFoundException - if the configuration files can't be found

getImplementations

public <T> List<T> getImplementations(Class<T> serviceClass)
Description copied from interface: IIoCRegistry
Returns the list of implementations for the given interface.

Specified by:
getImplementations in interface IIoCRegistry
Type Parameters:
T - the service's class
Parameters:
serviceClass - the service's interface type
Returns:
the list of instances for each service's implementation
See Also:
IIoCRegistry.getImplementations(java.lang.Class)


Copyright © 2012 Digitalis Informática Lda. All Rights Reserved.