org.jvnet.hk2.component
Interface BaseServiceLocator

All Known Subinterfaces:
SimpleServiceLocator
All Known Implementing Classes:
BaseServiceLocatorImpl, Habitat

Deprecated.

@Deprecated
@Contract
public interface BaseServiceLocator

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

Author:
Mason Taube

Method Summary
<T> Collection<T>
getAllByContract(Class<T> contractType)
          Deprecated. Gets all the inhabitants registered under the given Contract.
<T> Collection<T>
getAllByContract(String contractType)
          Deprecated.  
<T> T
getByContract(Class<T> contractType)
          Deprecated. Gets the object that has the given contract.
<T> T
getByContract(String contractType)
          Deprecated.  
<T> T
getByType(Class<T> implType)
          Deprecated. Gets the object of the given type.
<T> T
getByType(String implType)
          Deprecated. Gets the object of the given type.
<T> T
getComponent(Class<T> clazz)
          Deprecated.  
<T> T
getComponent(Class<T> contract, String name)
          Deprecated. Loads a component that implements the given contract and has the given name.
<T> T
getComponent(String fullQualifiedName, String name)
          Deprecated. Analogous to the following:
 

Method Detail

getComponent

<T> T getComponent(Class<T> contract,
                   String name)
               throws ComponentException
Deprecated. 
Loads a component that implements the given contract and has the given name.

Parameters:
name - can be null, in which case it'll only match to the unnamed component.
Returns:
null if no such service exists.
Throws:
ComponentException

getComponent

<T> T getComponent(String fullQualifiedName,
                   String name)
Deprecated. 
Analogous to the following:
 getComponent(contractClass.getName(), name);
 

Parameters:
fullQualifiedName - the contract class name
name - can be null, in which case it'll only match to the unnamed component.
Returns:
null if no such service exists.

getComponent

<T> T getComponent(Class<T> clazz)
               throws ComponentException
Deprecated. 
Throws:
ComponentException

getByType

<T> T getByType(Class<T> implType)
Deprecated. 
Gets the object of the given type.

Returns:
null if not found.

getByType

<T> T getByType(String implType)
Deprecated. 
Gets the object of the given type.

Returns:
null if not found.

getByContract

<T> T getByContract(Class<T> contractType)
Deprecated. 
Gets the object that has the given contract.

If there are more than one of them, this method arbitrarily return one of them.


getByContract

<T> T getByContract(String contractType)
Deprecated. 

getAllByContract

<T> Collection<T> getAllByContract(Class<T> contractType)
Deprecated. 
Gets all the inhabitants registered under the given Contract. This is an example of heterogeneous type-safe container.

Returns:
can be empty but never null.

getAllByContract

<T> Collection<T> getAllByContract(String contractType)
Deprecated. 


Copyright © 2013 Oracle Corporation. All Rights Reserved.