Package org.forgerock.audit
Class DependencyProviderBase
- java.lang.Object
-
- org.forgerock.audit.DependencyProviderBase
-
- All Implemented Interfaces:
DependencyProvider
public class DependencyProviderBase extends Object implements DependencyProvider
Base DependencyProvider that has provides no dependencies.
-
-
Constructor Summary
Constructors Constructor Description DependencyProviderBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
getDependency(Class<T> clazz)
Retrieve the dependency of type T.<T> T
register(Class<T> clazz, T obj)
Register a new provided dependency.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.forgerock.audit.DependencyProvider
getDependency
-
-
-
-
Method Detail
-
getDependency
public <T> T getDependency(Class<T> clazz) throws ClassNotFoundException
Retrieve the dependency of type T.- Specified by:
getDependency
in interfaceDependencyProvider
- Type Parameters:
T
- The type of the dependency class.- Parameters:
clazz
- the dependency's class- Returns:
- the dependency
- Throws:
ClassNotFoundException
- if provider does not have a class registered for the requested class type
-
register
public <T> T register(Class<T> clazz, T obj)
Register a new provided dependency.- Type Parameters:
T
- The type of the dependency.- Parameters:
clazz
- the class to registerobj
- the instance to provide- Returns:
- the previous values registered for clazz
-
-