org.jvnet.hk2.component
Interface SimpleServiceLocator

All Superinterfaces:
BaseServiceLocator
All Known Implementing Classes:
Habitat

public interface SimpleServiceLocator
extends BaseServiceLocator

Provide a simple abstraction for getting services by contract or type.

Author:
Jerome Dochez, Jeff Trent

Method Summary
<T> Collection<Inhabitant<T>>
getInhabitantsByContract(String contractName)
           
<T> Collection<Inhabitant<T>>
getInhabitantsByContract(Type contract)
          Gets all the inhabitants that has the given contract.
<T> Collection<Inhabitant<T>>
getInhabitantsByType(Class<T> type)
          Gets all the inhabitants that has the given type.
<T> Collection<Inhabitant<T>>
getInhabitantsByType(String typeName)
           
<T> Inhabitant<T>
getProvider(String fqcn, String name)
           
<T> Inhabitant<T>
getProvider(Type type, String name)
          Gets an inhabitant from its type and optionally name
 
Methods inherited from interface org.jvnet.hk2.component.BaseServiceLocator
getAllByContract, getAllByContract, getByContract, getByContract, getByType, getByType, getComponent, getComponent, getComponent
 

Method Detail

getProvider

<T> Inhabitant<T> getProvider(Type type,
                              String name)
Gets an inhabitant from its type and optionally name

Parameters:
type - requested inhabitant type
name - optional name

getProvider

<T> Inhabitant<T> getProvider(String fqcn,
                              String name)

getInhabitantsByContract

<T> Collection<Inhabitant<T>> getInhabitantsByContract(Type contract)
                                                   throws ComponentException
Gets all the inhabitants that has the given contract.

Throws:
ComponentException

getInhabitantsByContract

<T> Collection<Inhabitant<T>> getInhabitantsByContract(String contractName)
                                                   throws ComponentException
Throws:
ComponentException

getInhabitantsByType

<T> Collection<Inhabitant<T>> getInhabitantsByType(Class<T> type)
                                               throws ComponentException
Gets all the inhabitants that has the given type.

Throws:
ComponentException

getInhabitantsByType

<T> Collection<Inhabitant<T>> getInhabitantsByType(String typeName)
                                               throws ComponentException
Throws:
ComponentException


Copyright © 2012 Oracle Corporation. All Rights Reserved.