org.neo4j.graphdb
Interface DependencyResolver

All Known Implementing Classes:
DependencyResolver.Adapter, KernelExtensions

public interface DependencyResolver

Find a dependency given a type. This can be the exact type or a super type of the actual dependency.


Nested Class Summary
static class DependencyResolver.Adapter
          Adapter for DependencyResolver which will select the first available candidate by default for DependencyResolver.Adapter.resolveDependency(Class).
static interface DependencyResolver.SelectionStrategy<T>
          Responsible for making the choice between available candidates.
 
Method Summary
<T> T
resolveDependency(Class<T> type)
          Tries to resolve a dependency that matches a given class.
<T> T
resolveDependency(Class<T> type, DependencyResolver.SelectionStrategy<T> selector)
          Tries to resolve a dependency that matches a given class.
 

Method Detail

resolveDependency

<T> T resolveDependency(Class<T> type)
                    throws IllegalArgumentException
Tries to resolve a dependency that matches a given class. No specific DependencyResolver.SelectionStrategy is used, so the first encountered matching dependency will be returned.

Parameters:
type - the type of Class that the returned instance must implement.
Returns:
the resolved dependency for the given type.
Throws:
IllegalArgumentException - if no matching dependency was found.

resolveDependency

<T> T resolveDependency(Class<T> type,
                        DependencyResolver.SelectionStrategy<T> selector)
                    throws IllegalArgumentException
Tries to resolve a dependency that matches a given class. All candidates are fed to the selector which ultimately becomes responsible for making the choice between all available candidates.

Parameters:
type - the type of Class that the returned instance must implement.
selector - DependencyResolver.SelectionStrategy which will make the choice of which one to return among matching candidates.
Returns:
the resolved dependency for the given type.
Throws:
IllegalArgumentException - if no matching dependency was found.


Copyright © 2002-2013 The Neo4j Graph Database Project. All Rights Reserved.